Class: SnFoil::JsonapiDeserializerGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/snfoil/jsonapi_deserializer/jsonapi_deserializer_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_app_fileObject



25
26
27
28
29
30
31
32
33
# File 'lib/generators/snfoil/jsonapi_deserializer/jsonapi_deserializer_generator.rb', line 25

def add_app_file
  file_name = if modules.length.zero?
                name
              else
                "#{modules.join('/')}/#{name}"
              end

  template('jsonapi_deserializer.erb', "#{options[:path]}/#{file_name}_jsonapi_deserializer.rb")
end