Class: Wizard::Step
- Inherits:
-
Object
- Object
- Wizard::Step
- Defined in:
- lib/wizard/step.rb
Instance Attribute Summary collapse
-
#description_vars ⇒ Object
Returns the value of attribute description_vars.
-
#disabled ⇒ Object
Returns the value of attribute disabled.
-
#emoji ⇒ Object
Returns the value of attribute emoji.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#index ⇒ Object
Returns the value of attribute index.
-
#next ⇒ Object
Returns the value of attribute next.
-
#previous ⇒ Object
Returns the value of attribute previous.
-
#updater ⇒ Object
readonly
Returns the value of attribute updater.
Instance Method Summary collapse
- #add_field(attrs) {|field| ... } ⇒ Object
- #has_fields? ⇒ Boolean
-
#initialize(id) ⇒ Step
constructor
A new instance of Step.
- #on_update(&block) ⇒ Object
Constructor Details
#initialize(id) ⇒ Step
Returns a new instance of Step.
8 9 10 11 |
# File 'lib/wizard/step.rb', line 8 def initialize(id) @id = id @fields = [] end |
Instance Attribute Details
#description_vars ⇒ Object
Returns the value of attribute description_vars.
6 7 8 |
# File 'lib/wizard/step.rb', line 6 def description_vars @description_vars end |
#disabled ⇒ Object
Returns the value of attribute disabled.
6 7 8 |
# File 'lib/wizard/step.rb', line 6 def disabled @disabled end |
#emoji ⇒ Object
Returns the value of attribute emoji.
6 7 8 |
# File 'lib/wizard/step.rb', line 6 def emoji @emoji end |
#fields ⇒ Object
Returns the value of attribute fields.
6 7 8 |
# File 'lib/wizard/step.rb', line 6 def fields @fields end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/wizard/step.rb', line 5 def id @id end |
#index ⇒ Object
Returns the value of attribute index.
6 7 8 |
# File 'lib/wizard/step.rb', line 6 def index @index end |
#next ⇒ Object
Returns the value of attribute next.
6 7 8 |
# File 'lib/wizard/step.rb', line 6 def next @next end |
#previous ⇒ Object
Returns the value of attribute previous.
6 7 8 |
# File 'lib/wizard/step.rb', line 6 def previous @previous end |
#updater ⇒ Object (readonly)
Returns the value of attribute updater.
5 6 7 |
# File 'lib/wizard/step.rb', line 5 def updater @updater end |
Instance Method Details
#add_field(attrs) {|field| ... } ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/wizard/step.rb', line 13 def add_field(attrs) field = Field.new(attrs) field.step = self @fields << field yield field if block_given? field end |
#has_fields? ⇒ Boolean
21 22 23 |
# File 'lib/wizard/step.rb', line 21 def has_fields? @fields.present? end |
#on_update(&block) ⇒ Object
25 26 27 |
# File 'lib/wizard/step.rb', line 25 def on_update(&block) @updater = block end |