Module: Wicked::Controller::Concerns::Steps
- Extended by:
- ActiveSupport::Concern
- Included in:
- Wizard
- Defined in:
- lib/wicked/controller/concerns/steps.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #jump_to(goto_step) ⇒ Object
- #next_step(current_step) ⇒ Object
- #previous_step(current_step) ⇒ Object
- #skip_step ⇒ Object
- #step ⇒ Object
- #steps ⇒ Object
Instance Method Details
#jump_to(goto_step) ⇒ Object
5 6 7 |
# File 'lib/wicked/controller/concerns/steps.rb', line 5 def jump_to(goto_step) @skip_to = goto_step end |
#next_step(current_step) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/wicked/controller/concerns/steps.rb', line 33 def next_step(current_step) index = steps.index(current_step) step = steps.at(index + 1) if index.present? step ||= :finish step end |
#previous_step(current_step) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/wicked/controller/concerns/steps.rb', line 40 def previous_step(current_step) index = steps.index(current_step) step = steps.at(index - 1) if index.present? step ||= steps.at(0) step end |
#skip_step ⇒ Object
9 10 11 |
# File 'lib/wicked/controller/concerns/steps.rb', line 9 def skip_step @skip_to = @next_step end |
#step ⇒ Object
13 14 15 |
# File 'lib/wicked/controller/concerns/steps.rb', line 13 def step @step end |
#steps ⇒ Object
28 29 30 |
# File 'lib/wicked/controller/concerns/steps.rb', line 28 def steps self.class.steps end |