Module: Card::View::Options

Extended by:
KeyLists
Includes:
Visibility, VooApi
Included in:
Card::View
Defined in:
card/lib/card/view/options.rb,
card/lib/card/view/options/voo_api.rb,
card/lib/card/view/options/key_lists.rb,
card/lib/card/view/options/visibility.rb

Overview

Manages options for rendering card views

Many options are available to sharks via nests. (See https://decko.org/Nest_Syntax)

 {{cardname|hide:menu}}

These options and others are available to monkeys when rendering views via #render or #nest.

 nest "cardname", hide: :menu
 render :viewname, hide: :menu

Defined Under Namespace

Modules: KeyLists, Visibility, VooApi

Constant Summary

Constants included from Visibility

Visibility::VIZ_SETTING

Class Attribute Summary collapse

Attributes included from VooApi

#normalized_options

Class Method Summary collapse

Methods included from KeyLists

accessible_keys, all_keys, heir_keys, reset_key_lists, shark_keys, slot_keys

Methods included from Visibility

#hide, #hide!, #hide?, #optional?, #process_visibility, #show, #show!, #show?, #visible?, #viz, #viz_hash

Methods included from VooApi

define_getter, define_setter, included, #items, #normalize_cache, #normalize_edit, #normalize_input_type, #normalize_special_options!, #normalize_wrap, #slot_options, #special_option_value

Class Attribute Details

.keymapObject (readonly)

Returns the value of attribute keymap.



77
78
79
# File 'card/lib/card/view/options.rb', line 77

def keymap
  @keymap
end

Class Method Details

.add_option(name, type) ⇒ Object



79
80
81
82
83
84
85
86
# File 'card/lib/card/view/options.rb', line 79

def add_option name, type
  raise "invalid option type: #{type}" unless @keymap.key?(type)

  @keymap[type] << name
  reset_key_lists
  VooApi.define_getter name
  VooApi.define_setter name
end