Class: CommonRepositoryModel::CollectionGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- CommonRepositoryModel::CollectionGenerator
- Defined in:
- lib/generators/common_repository_model/collection/collection_generator.rb
Instance Method Summary collapse
- #create_collection ⇒ Object
- #create_fixture_file ⇒ Object
- #create_serializer ⇒ Object
- #create_serializer_spec ⇒ Object
- #create_service_spec ⇒ Object
Instance Method Details
#create_collection ⇒ Object
8 9 10 11 12 13 |
# File 'lib/generators/common_repository_model/collection/collection_generator.rb', line 8 def create_collection template( 'collection.rb.erb', File.join('app/repository_models/', "#{file_name}.rb") ) end |
#create_fixture_file ⇒ Object
22 23 24 |
# File 'lib/generators/common_repository_model/collection/collection_generator.rb', line 22 def create_fixture_file template 'collection_factory.rb.erb', File.join([:test_dir], "#{file_name}_factory.rb") end |
#create_serializer ⇒ Object
26 27 28 29 30 31 |
# File 'lib/generators/common_repository_model/collection/collection_generator.rb', line 26 def create_serializer template( 'collection_serializer.rb.erb', File.join('app/repository_serializers/', "#{file_name}_serializer.rb") ) end |
#create_serializer_spec ⇒ Object
33 34 35 36 37 38 |
# File 'lib/generators/common_repository_model/collection/collection_generator.rb', line 33 def create_serializer_spec template( 'collection_serializer_spec.rb.erb', File.join('spec/repository_serializers/', "#{file_name}_serializer_spec.rb") ) end |
#create_service_spec ⇒ Object
15 16 17 18 19 20 |
# File 'lib/generators/common_repository_model/collection/collection_generator.rb', line 15 def create_service_spec template( 'collection_spec.rb.erb', File.join('spec/repository_models/', "#{file_name}_spec.rb") ) end |