Class: Corzinus::StepGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Corzinus::StepGenerator
- Defined in:
- lib/generators/corzinus/step_generator.rb
Instance Method Summary collapse
- #add_step_command ⇒ Object
- #add_step_service ⇒ Object
- #add_step_view ⇒ Object
- #add_to_checkout_steps ⇒ Object
Instance Method Details
#add_step_command ⇒ Object
46 47 48 49 50 |
# File 'lib/generators/corzinus/step_generator.rb', line 46 def add_step_command @step_name = step_name.underscore @step_class = @step_name.camelize template 'generate_step/command_step.rb', "app/commands/corzinus/checkout/#{step_name.underscore}_step.rb" end |
#add_step_service ⇒ Object
41 42 43 44 |
# File 'lib/generators/corzinus/step_generator.rb', line 41 def add_step_service @step_class = step_name.underscore.camelize template 'generate_step/access_service.rb', "app/services/corzinus/checkout/#{step_name.underscore}_access_service.rb" end |
#add_step_view ⇒ Object
52 53 54 55 |
# File 'lib/generators/corzinus/step_generator.rb', line 52 def add_step_view @step_class = step_name.underscore.camelize template 'generate_step/step.html.haml', "app/views/corzinus/checkouts/#{step_name.underscore}.html.haml" end |
#add_to_checkout_steps ⇒ Object
34 35 36 37 38 39 |
# File 'lib/generators/corzinus/step_generator.rb', line 34 def add_to_checkout_steps steps = new_checkout_steps(current_steps) gsub_file initializer_path, /config.checkout_steps.*/ do "config.checkout_steps = #{steps}" end end |