Class: Servus::Generators::ServiceGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Servus::Generators::ServiceGenerator
- Defined in:
- lib/generators/servus/service/service_generator.rb
Overview
Rails generator for creating Servus service objects.
Generates a complete service structure including:
- Service class file
- RSpec test file
Instance Method Summary collapse
-
#create_service_file ⇒ void
Creates all service-related files.
Instance Method Details
#create_service_file ⇒ void
This method returns an undefined value.
Creates all service-related files.
Generates the service class and spec file from templates.
Schemas are declared inline with the schema DSL, so there are no
schema files to generate — the service template scaffolds them in place.
36 37 38 39 |
# File 'lib/generators/servus/service/service_generator.rb', line 36 def create_service_file template 'service.rb.erb', service_path template 'service_spec.rb.erb', service_path_spec end |