Class: HungryForm::Elements::RadioGroup
- Inherits:
-
Base::OptionsElement
- Object
- Base::Element
- Base::ActiveElement
- Base::OptionsElement
- HungryForm::Elements::RadioGroup
- Defined in:
- lib/hungryform/elements/radio_group.rb
Instance Attribute Summary
Attributes inherited from Base::OptionsElement
Attributes inherited from Base::ActiveElement
Attributes inherited from Base::Element
#attributes, #dependency, #label, #name, #placeholders, #resolver, #visible
Instance Method Summary collapse
-
#set_value ⇒ Object
Sets a value of the element Checks the value from the resolver params against the available options.
Methods inherited from Base::OptionsElement
Methods inherited from Base::ActiveElement
#clear_error, #initialize, #invalid?, #valid?, #validate_rule
Methods inherited from Base::Element
#configuration, #dependency_json, #initialize
Methods included from Base::Hashable
Constructor Details
This class inherits a constructor from HungryForm::Elements::Base::OptionsElement
Instance Method Details
#set_value ⇒ Object
Sets a value of the element Checks the value from the resolver params against the available options
6 7 8 9 10 11 12 13 14 |
# File 'lib/hungryform/elements/radio_group.rb', line 6 def set_value if resolver.params.key?(name) if .keys.include?(resolver.params[name]) self.value = resolver.params[name] end else self.value = attributes.delete(:value) end end |