Class: Clack::Core::Option
- Inherits:
-
Data
- Object
- Data
- Clack::Core::Option
- Defined in:
- lib/clack/core/options_helper.rb
Overview
Value object for normalized select-style options.
Instance Attribute Summary collapse
-
#disabled ⇒ Object
readonly
Returns the value of attribute disabled.
-
#hint ⇒ Object
readonly
Returns the value of attribute hint.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#[](key) ⇒ Object
Hash-style read access for backward compatibility with code (e.g. custom autocomplete filters) written against the old option hashes.
- #to_s ⇒ Object
Instance Attribute Details
#disabled ⇒ Object (readonly)
Returns the value of attribute disabled
6 7 8 |
# File 'lib/clack/core/options_helper.rb', line 6 def disabled @disabled end |
#hint ⇒ Object (readonly)
Returns the value of attribute hint
6 7 8 |
# File 'lib/clack/core/options_helper.rb', line 6 def hint @hint end |
#label ⇒ Object (readonly)
Returns the value of attribute label
6 7 8 |
# File 'lib/clack/core/options_helper.rb', line 6 def label @label end |
#value ⇒ Object (readonly)
Returns the value of attribute value
6 7 8 |
# File 'lib/clack/core/options_helper.rb', line 6 def value @value end |
Instance Method Details
#[](key) ⇒ Object
Hash-style read access for backward compatibility with code (e.g. custom autocomplete filters) written against the old option hashes.
11 |
# File 'lib/clack/core/options_helper.rb', line 11 def [](key) = to_h[key] |
#to_s ⇒ Object
7 |
# File 'lib/clack/core/options_helper.rb', line 7 def to_s = label.to_s |