Class: OdataDuty::Generators::EntitySetGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/odata_duty/entity_set/entity_set_generator.rb

Overview

EntitySetGenerator creates OData entity types and sets

Instance Method Summary collapse

Instance Method Details

#create_active_record_concernObject



17
18
19
20
# File 'lib/generators/odata_duty/entity_set/entity_set_generator.rb', line 17

def create_active_record_concern
  template 'odata_active_record_concern.rb.erb',
           File.join('app/odata', 'odata_active_record_concern.rb')
end

#create_entity_setObject



22
23
24
# File 'lib/generators/odata_duty/entity_set/entity_set_generator.rb', line 22

def create_entity_set
  template 'entity_set.rb.erb', File.join('app/odata', "#{file_name}_set.rb")
end

#create_entity_typeObject



13
14
15
# File 'lib/generators/odata_duty/entity_set/entity_set_generator.rb', line 13

def create_entity_type
  template 'entity_type.rb.erb', File.join('app/odata', "#{file_name}_entity.rb")
end

#create_testsObject



26
27
28
29
30
31
# File 'lib/generators/odata_duty/entity_set/entity_set_generator.rb', line 26

def create_tests
  return if options[:skip_tests]

  template 'entity_type_spec.rb.erb', File.join('spec/odata', "#{file_name}_entity_spec.rb")
  template 'entity_set_spec.rb.erb', File.join('spec/odata', "#{file_name}_set_spec.rb")
end