Class: ActiveElement::FieldOptions
- Inherits:
-
Object
- Object
- ActiveElement::FieldOptions
- Defined in:
- lib/active_element/field_options.rb
Instance Attribute Summary collapse
-
#exact_match ⇒ Object
Returns the value of attribute exact_match.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#options ⇒ Object
Returns the value of attribute options.
- #type ⇒ Object
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(field) ⇒ FieldOptions
constructor
A new instance of FieldOptions.
Constructor Details
#initialize(field) ⇒ FieldOptions
Returns a new instance of FieldOptions.
16 17 18 19 |
# File 'lib/active_element/field_options.rb', line 16 def initialize(field) @field = field @options = {} end |
Instance Attribute Details
#exact_match ⇒ Object
Returns the value of attribute exact_match.
3 4 5 |
# File 'lib/active_element/field_options.rb', line 3 def exact_match @exact_match end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
5 6 7 |
# File 'lib/active_element/field_options.rb', line 5 def field @field end |
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/active_element/field_options.rb', line 3 def @options end |
#type ⇒ Object
21 22 23 |
# File 'lib/active_element/field_options.rb', line 21 def type @type || :text_field end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/active_element/field_options.rb', line 3 def value @value end |
Class Method Details
.from_state(field, state, record, controller) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/active_element/field_options.rb', line 7 def self.from_state(field, state, record, controller) block = state.[field] return nil if block.blank? = new(field) block.call(, record, controller) end |