Class: OdataDuty::Generators::EntitySetGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- OdataDuty::Generators::EntitySetGenerator
- Defined in:
- lib/generators/odata_duty/entity_set/entity_set_generator.rb
Overview
EntitySetGenerator creates OData entity types and sets
Instance Method Summary collapse
- #create_active_record_concern ⇒ Object
- #create_entity_set ⇒ Object
- #create_entity_type ⇒ Object
- #create_tests ⇒ Object
Instance Method Details
#create_active_record_concern ⇒ Object
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_set ⇒ Object
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_type ⇒ Object
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_tests ⇒ Object
26 27 28 29 30 31 |
# File 'lib/generators/odata_duty/entity_set/entity_set_generator.rb', line 26 def create_tests return if [: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 |