Class: DatashiftJourney::FormsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- DatashiftJourney::FormsGenerator
- Defined in:
- lib/generators/datashift_journey/forms_generator.rb
Instance Attribute Summary collapse
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
Instance Attribute Details
#state ⇒ Object
Returns the value of attribute state.
7 8 9 |
# File 'lib/generators/datashift_journey/forms_generator.rb', line 7 def state @state end |
Instance Method Details
#create_form_per_state ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/generators/datashift_journey/forms_generator.rb', line 16 def create_form_per_state method_ptr = if ["no-collector"] == false || DatashiftJourney.journey_plan_class == DatashiftJourney::Collector::Collector ->() { state_forms_for_collector_definition } else ->() { state_form_definition } end DatashiftJourney.journey_plan_class.state_machine(:state).states.map(&:name).each do |state| @state = state method_ptr.call end end |