Module: Card::View::Options
- Included in:
- Card::View
- Defined in:
- lib/card/view/options.rb
Overview
normalizes and manages standard view options
Class Attribute Summary collapse
-
.keymap ⇒ Object
readonly
Returns the value of attribute keymap.
Instance Attribute Summary collapse
-
#normalized_options ⇒ Object
readonly
There are two primary options hashes: - @normalized_options are determined upon initialization and do not change after that.
Class Method Summary collapse
-
.all_keys ⇒ Object
all standard option keys.
-
.heir_keys ⇒ Object
keys that follow simple standard inheritance pattern from parent views.
-
.nest_keys ⇒ Object
keys whose values can be set by Wagneers in card nests.
Instance Method Summary collapse
-
#items ⇒ Object
The following methods comprise the primary voo API.
- #live_options ⇒ Object
- #normalize_editor(value) ⇒ Object
-
#slot_options ⇒ Object
options to be used in data attributes of card slots (normalized options with standard keys).
Class Attribute Details
.keymap ⇒ Object (readonly)
Returns the value of attribute keymap.
42 43 44 |
# File 'lib/card/view/options.rb', line 42 def keymap @keymap end |
Instance Attribute Details
#normalized_options ⇒ Object (readonly)
There are two primary options hashes:
- @normalized_options are determined upon initialization and do not change after that.
- @live_options are created during the "process" phase, and they can be altered via the "voo" API at any time
66 67 68 |
# File 'lib/card/view/options.rb', line 66 def @normalized_options end |
Class Method Details
.all_keys ⇒ Object
all standard option keys
45 46 47 |
# File 'lib/card/view/options.rb', line 45 def all_keys @all_keys ||= keymap.each_with_object([]) { |(_k, v), a| a.push(*v) } end |
.heir_keys ⇒ Object
keys that follow simple standard inheritance pattern from parent views
55 56 57 |
# File 'lib/card/view/options.rb', line 55 def heir_keys @heir_keys ||= ::Set.new(keymap[:both]) + keymap[:heir] end |
.nest_keys ⇒ Object
keys whose values can be set by Wagneers in card nests
50 51 52 |
# File 'lib/card/view/options.rb', line 50 def nest_keys @nest_keys ||= ::Set.new(keymap[:both]) + keymap[:nest] end |
Instance Method Details
#items ⇒ Object
The following methods comprise the primary voo API. They allow developers to read and write options dynamically
75 76 77 |
# File 'lib/card/view/options.rb', line 75 def items [:items] ||= {} end |
#live_options ⇒ Object
68 69 70 |
# File 'lib/card/view/options.rb', line 68 def @live_options ||= end |
#normalize_editor(value) ⇒ Object
91 92 93 |
# File 'lib/card/view/options.rb', line 91 def normalize_editor value value && value.to_sym end |