diff --git a/lib/generators/categoria/data_generator.rb b/lib/generators/categoria/data_generator.rb index e379f2a..f48de7e 100644 --- a/lib/generators/categoria/data_generator.rb +++ b/lib/generators/categoria/data_generator.rb @@ -7,6 +7,12 @@ class DataGenerator < ::Rails::Generators::NamedBase extend T::Sig source_root File.expand_path("templates", __dir__) + + desc <<~DOC.squish + generates a data class for the domain. data classes are used + like value classes: hashes are more fit for the purpose except + that in the wild hashes are difficult to tame. + DOC end end end diff --git a/lib/generators/categoria/templates/data.rb.erb b/lib/generators/categoria/templates/data.rb.erb index e69de29..cea8572 100644 --- a/lib/generators/categoria/templates/data.rb.erb +++ b/lib/generators/categoria/templates/data.rb.erb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module <%= Rails.application.class.module_parent %> + module <%= domain_module %> + module Data + class <%= data_class_name %> < ::Categoria::Data + end + end + end +end +