Module: Card::View::Options::KeyLists

Included in:
Card::View::Options
Defined in:
lib/card/view/options/key_lists.rb

Instance Method Summary collapse

Instance Method Details

#accessible_keysArray

Keys that can be read or written via accessors

Returns:

  • (Array)


25
26
27
28
29
30
31
# File 'lib/card/view/options/key_lists.rb', line 25

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_keysArray

all standard option keys

Returns:

  • (Array)


7
8
9
# File 'lib/card/view/options/key_lists.rb', line 7

def all_keys
  @all_keys ||= keymap.each_with_object([]) { |(_k, v), a| a.push(*v) }
end

#heir_keysArray

keys that follow simple standard inheritance pattern from parent views

Returns:

  • (Array)


19
20
21
# File 'lib/card/view/options/key_lists.rb', line 19

def heir_keys
  @heir_keys ||= ::Set.new(keymap[:both]) + keymap[:heir]
end

#reset_key_listsObject



33
34
35
36
37
# File 'lib/card/view/options/key_lists.rb', line 33

def reset_key_lists
  @all_keys = nil
  @ruler_keys = nil
  @heir_keys = nil
end

#ruler_keysArray

keys whose values can be set by Deckers in card nests

Returns:

  • (Array)


13
14
15
# File 'lib/card/view/options/key_lists.rb', line 13

def ruler_keys
  @ruler_keys ||= ::Set.new(keymap[:both]) + keymap[:ruler]
end