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
- JSON schema files for arguments and results
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, spec file, and schema files from templates.
36 37 38 39 40 41 42 43 |
# 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 # Template json schemas template 'result.json.erb', service_result_schema_path template 'arguments.json.erb', service_arguments_shecma_path end |