Class: ActiveForm::Element::CollectionOption
- Defined in:
- lib/active_form/mixins/collection_element_methods.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(label, value) ⇒ CollectionOption
constructor
A new instance of CollectionOption.
Constructor Details
#initialize(label, value) ⇒ CollectionOption
Returns a new instance of CollectionOption.
182 183 184 |
# File 'lib/active_form/mixins/collection_element_methods.rb', line 182 def initialize(label, value) @label, @value = label.to_s, value end |
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label.
180 181 182 |
# File 'lib/active_form/mixins/collection_element_methods.rb', line 180 def label @label end |
#value ⇒ Object
Returns the value of attribute value.
180 181 182 |
# File 'lib/active_form/mixins/collection_element_methods.rb', line 180 def value @value end |