Class: Wizardly::Wizard::Page
- Inherits:
-
Object
- Object
- Wizardly::Wizard::Page
- Includes:
- TextHelpers
- Defined in:
- lib/wizardly/wizard/page.rb
Instance Attribute Summary collapse
-
#buttons ⇒ Object
Returns the value of attribute buttons.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #buttons_to(*args) ⇒ Object
- #description_to(name) ⇒ Object
-
#initialize(config, id, fields) ⇒ Page
constructor
A new instance of Page.
- #name ⇒ Object
- #title_to(name) ⇒ Object
Constructor Details
#initialize(config, id, fields) ⇒ Page
Returns a new instance of Page.
11 12 13 14 15 16 17 18 |
# File 'lib/wizardly/wizard/page.rb', line 11 def initialize(config, id, fields) @buttons = [] @title = (id) @id = id @description = '' @fields = fields @config = config end |
Instance Attribute Details
#buttons ⇒ Object
Returns the value of attribute buttons.
9 10 11 |
# File 'lib/wizardly/wizard/page.rb', line 9 def @buttons end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/wizardly/wizard/page.rb', line 8 def description @description end |
#fields ⇒ Object
Returns the value of attribute fields.
9 10 11 |
# File 'lib/wizardly/wizard/page.rb', line 9 def fields @fields end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/wizardly/wizard/page.rb', line 8 def id @id end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
8 9 10 |
# File 'lib/wizardly/wizard/page.rb', line 8 def title @title end |
Instance Method Details
#buttons_to(*args) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/wizardly/wizard/page.rb', line 22 def (*args) = @config. @buttons = args.map do || raise(WizardConfigurationError, ":#{} not defined as a button id in :button_to() call", caller) unless .key?() [] end end |
#description_to(name) ⇒ Object
32 33 34 |
# File 'lib/wizardly/wizard/page.rb', line 32 def description_to(name) @description = name.strip.squeeze(' ') end |
#name ⇒ Object
20 |
# File 'lib/wizardly/wizard/page.rb', line 20 def name; id.to_s; end |
#title_to(name) ⇒ Object
29 30 31 |
# File 'lib/wizardly/wizard/page.rb', line 29 def title_to(name) @title = name.strip.squeeze(' ') end |