Module: Domkey::View::OptionSelectable
- Included in:
- OptionSelectableGroup, SelectList
- Defined in:
- lib/domkey/view/option_selectable.rb
Instance Method Summary collapse
- #options(*opts) ⇒ Object
-
#set(value) ⇒ Object
clears all options and sets only the desired value(s) Clients need to implement individual strategy for each ‘how’ => ‘value’ pair based on what it means to be selected by what.
- #value(*opts) ⇒ Array<String>, ...
Instance Method Details
#options(*opts) ⇒ Object
27 28 29 30 31 |
# File 'lib/domkey/view/option_selectable.rb', line 27 def *opts opts = opts.flatten return if opts.empty? opts end |
#set(value) ⇒ Object
clears all options and sets only the desired value(s) Clients need to implement individual strategy for each ‘how’ => ‘value’ pair based on what it means to be selected by what
11 12 13 14 |
# File 'lib/domkey/view/option_selectable.rb', line 11 def set value before_set set_strategy value end |
#value(*opts) ⇒ Array<String>, ...
20 21 22 23 24 |
# File 'lib/domkey/view/option_selectable.rb', line 20 def value *opts opts = opts.flatten return value_by_default if (opts.empty? || opts.find { |e| e.kind_of?(String) }) opts end |