Class: LocastyleComponents::Forms::SwitchButton
- Defined in:
- lib/locastyle_components/forms/switch_button.rb
Overview
Instance Attribute Summary collapse
-
#attribute ⇒ Object
Returns the value of attribute attribute.
-
#form ⇒ Object
Returns the value of attribute form.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#object ⇒ Object
Returns the value of attribute object.
-
#options ⇒ Object
Returns the value of attribute options.
-
#view ⇒ Object
Returns the value of attribute view.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(form, view, attribute, options) ⇒ SwitchButton
constructor
A new instance of SwitchButton.
Methods inherited from Base
Constructor Details
#initialize(form, view, attribute, options) ⇒ SwitchButton
Returns a new instance of SwitchButton.
10 11 12 13 14 15 16 17 18 |
# File 'lib/locastyle_components/forms/switch_button.rb', line 10 def initialize(form, view, attribute, ) @form = form @view = view @attribute = attribute.to_s @options = Hash() @object = form.object @klass = object.class.name.underscore end |
Instance Attribute Details
#attribute ⇒ Object
Returns the value of attribute attribute.
8 9 10 |
# File 'lib/locastyle_components/forms/switch_button.rb', line 8 def attribute @attribute end |
#form ⇒ Object
Returns the value of attribute form.
8 9 10 |
# File 'lib/locastyle_components/forms/switch_button.rb', line 8 def form @form end |
#klass ⇒ Object
Returns the value of attribute klass.
8 9 10 |
# File 'lib/locastyle_components/forms/switch_button.rb', line 8 def klass @klass end |
#object ⇒ Object
Returns the value of attribute object.
8 9 10 |
# File 'lib/locastyle_components/forms/switch_button.rb', line 8 def object @object end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/locastyle_components/forms/switch_button.rb', line 8 def @options end |
#view ⇒ Object
Returns the value of attribute view.
8 9 10 |
# File 'lib/locastyle_components/forms/switch_button.rb', line 8 def view @view end |
Instance Method Details
#build ⇒ Object
20 21 22 23 |
# File 'lib/locastyle_components/forms/switch_button.rb', line 20 def build return label + switch if use_label? switch end |