Module: Card::Set::All::Item::Format
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- tmpsets/set/mod003-core/all/item.rb
Instance Method Summary collapse
- #default_item_view ⇒ Object
- #determine_item_view_options_type(options) ⇒ Object
- #implicit_item_view ⇒ Object
- #item_links(_args = {}) ⇒ Object
- #item_view_options(new_options = {}) ⇒ Object
- #listing(listing_cards, item_args = {}) ⇒ Object
- #nest_item(cardish, options = {}, &block) ⇒ Object
- #voo_items_view ⇒ Object
- #wrap_item(item, _args = {}) ⇒ Object
Instance Method Details
#default_item_view ⇒ Object
86 87 88 |
# File 'tmpsets/set/mod003-core/all/item.rb', line 86 def default_item_view :name end |
#determine_item_view_options_type(options) ⇒ Object
98 99 100 101 102 |
# File 'tmpsets/set/mod003-core/all/item.rb', line 98 def return if [:type] type_from_rule = card.item_type [:type] = type_from_rule if type_from_rule end |
#implicit_item_view ⇒ Object
76 77 78 79 |
# File 'tmpsets/set/mod003-core/all/item.rb', line 76 def implicit_item_view view = voo_items_view || default_item_view Card::View.normalize view end |
#item_links(_args = {}) ⇒ Object
66 67 68 |
# File 'tmpsets/set/mod003-core/all/item.rb', line 66 def item_links _args={} raw(render_core).split(/[,\n]/) end |
#item_view_options(new_options = {}) ⇒ Object
90 91 92 93 94 95 96 |
# File 'tmpsets/set/mod003-core/all/item.rb', line 90 def ={} = (voo.items || {}).clone = .merge [:view] ||= implicit_item_view end |
#listing(listing_cards, item_args = {}) ⇒ Object
104 105 106 107 108 109 110 |
# File 'tmpsets/set/mod003-core/all/item.rb', line 104 def listing listing_cards, item_args={} listing_cards.map do |item_card| nest_item item_card, item_args do |rendered, item_view| wrap_item rendered, item_view end end end |
#nest_item(cardish, options = {}, &block) ⇒ Object
70 71 72 73 74 |
# File 'tmpsets/set/mod003-core/all/item.rb', line 70 def nest_item cardish, ={}, &block = [:nest_name] = Card::Name[cardish].s nest cardish, , &block end |
#voo_items_view ⇒ Object
81 82 83 84 |
# File 'tmpsets/set/mod003-core/all/item.rb', line 81 def voo_items_view return unless voo && (items = voo.items) items[:view] end |
#wrap_item(item, _args = {}) ⇒ Object
112 113 114 |
# File 'tmpsets/set/mod003-core/all/item.rb', line 112 def wrap_item item, _args={} item # no wrap in base end |