Class: GatherContent::Config::Element::OtherOption
- Defined in:
- lib/gather_content/config/elements/other_option.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
-
#name ⇒ Object
Returns the value of attribute name.
-
#selected ⇒ Object
Returns the value of attribute selected.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name = nil, label = nil, selected = nil, value = nil) ⇒ OtherOption
constructor
A new instance of OtherOption.
- #serialize(options = nil) ⇒ Object
Methods inherited from Option
Constructor Details
#initialize(name = nil, label = nil, selected = nil, value = nil) ⇒ OtherOption
Returns a new instance of OtherOption.
9 10 11 12 |
# File 'lib/gather_content/config/elements/other_option.rb', line 9 def initialize(name = nil, label = nil, selected = nil, value = nil) super(name, label, selected) @value = value end |
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label.
7 8 9 |
# File 'lib/gather_content/config/elements/other_option.rb', line 7 def label @label end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/gather_content/config/elements/other_option.rb', line 7 def name @name end |
#selected ⇒ Object
Returns the value of attribute selected.
7 8 9 |
# File 'lib/gather_content/config/elements/other_option.rb', line 7 def selected @selected end |
#value ⇒ Object
Returns the value of attribute value.
7 8 9 |
# File 'lib/gather_content/config/elements/other_option.rb', line 7 def value @value end |
Instance Method Details
#serialize(options = nil) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/gather_content/config/elements/other_option.rb', line 14 def serialize( = nil) base = super() value = !!selected ? self.value : "" base.merge({ value: value }) end |