Module: Card::View::Options::KeyLists
- Included in:
- Card::View::Options
- Defined in:
- lib/card/view/options/key_lists.rb
Overview
lists of view option keys
Instance Method Summary collapse
-
#accessible_keys ⇒ Array
Keys that can be read or written via accessors.
-
#all_keys ⇒ Array
all standard option keys.
-
#heir_keys ⇒ Array
keys that follow simple standard inheritance pattern from parent views.
- #reset_key_lists ⇒ Object
-
#shark_keys ⇒ Array
keys whose values can be set by Sharks in card nests.
- #slot_keys ⇒ Object
Instance Method Details
#accessible_keys ⇒ Array
Keys that can be read or written via accessors
26 27 28 29 30 31 32 |
# File 'lib/card/view/options/key_lists.rb', line 26 def accessible_keys all_keys - [ # (all but the following) :view, # view is accessed as requested_view or ok_view and cannot be # directly manipulated :show, :hide # these have a more extensive API (see Card::View::Visibility) ] end |
#all_keys ⇒ Array
all standard option keys
8 9 10 |
# File 'lib/card/view/options/key_lists.rb', line 8 def all_keys @all_keys ||= keymap.each_with_object([]) { |(_k, v), a| a.push(*v) } end |
#heir_keys ⇒ Array
keys that follow simple standard inheritance pattern from parent views
20 21 22 |
# File 'lib/card/view/options/key_lists.rb', line 20 def heir_keys @heir_keys ||= ::Set.new(keymap[:both]) + keymap[:heir] end |
#reset_key_lists ⇒ Object
38 39 40 41 42 |
# File 'lib/card/view/options/key_lists.rb', line 38 def reset_key_lists @all_keys = nil @shark_keys = nil @heir_keys = nil end |
#shark_keys ⇒ Array
keys whose values can be set by Sharks in card nests
14 15 16 |
# File 'lib/card/view/options/key_lists.rb', line 14 def shark_keys @shark_keys ||= ::Set.new(keymap[:both]) + keymap[:shark] end |
#slot_keys ⇒ Object
34 35 36 |
# File 'lib/card/view/options/key_lists.rb', line 34 def slot_keys @slot_keys ||= all_keys - [:skip_perms] end |