Module: Card::Set::All::Item::Format
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod002-collection/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(item_card, item_args = {}) ⇒ Object
-
#listing_list(listing_cards, item_args = {}) ⇒ Object
-
#nest_item(cardish, options = {}, &block) ⇒ Object
-
#view: count ⇒ Object
-
#voo_items_view ⇒ Object
-
#wrap_item(item, _args = {}) ⇒ Object
Instance Method Details
#default_item_view ⇒ Object
152 153 154 |
# File 'platypus/tmp/set/gem-defaults/mod002-collection/all/item.rb', line 152 def default_item_view :name end |
#determine_item_view_options_type(options) ⇒ Object
164 165 166 167 168 169 |
# File 'platypus/tmp/set/gem-defaults/mod002-collection/all/item.rb', line 164 def return if [:type] type_name = card.item_type_name [:type] = type_name if type_name end |
#implicit_item_view ⇒ Object
141 142 143 144 |
# File 'platypus/tmp/set/gem-defaults/mod002-collection/all/item.rb', line 141 def implicit_item_view view = voo_items_view || default_item_view Card::View.normalize view end |
#item_links(args = {}) ⇒ Object
135 136 137 138 139 |
# File 'platypus/tmp/set/gem-defaults/mod002-collection/all/item.rb', line 135 def item_links args={} card.item_cards(args).map do |item_card| nest_item item_card, view: :link end end |
#item_view_options(new_options = {}) ⇒ Object
156 157 158 159 160 161 162 |
# File 'platypus/tmp/set/gem-defaults/mod002-collection/all/item.rb', line 156 def ={} = (voo.items || {}).clone = .merge [:view] ||= implicit_item_view end |
#listing(item_card, item_args = {}) ⇒ Object
175 176 177 178 179 |
# File 'platypus/tmp/set/gem-defaults/mod002-collection/all/item.rb', line 175 def listing item_card, item_args={} nest_item item_card, item_args do |rendered, item_view| wrap_item rendered, item_view end end |
#listing_list(listing_cards, item_args = {}) ⇒ Object
171 172 173 |
# File 'platypus/tmp/set/gem-defaults/mod002-collection/all/item.rb', line 171 def listing_list listing_cards, item_args={} listing_cards.map { |item_card| listing item_card, item_args } end |
#nest_item(cardish, options = {}, &block) ⇒ Object
129 130 131 132 133 |
# File 'platypus/tmp/set/gem-defaults/mod002-collection/all/item.rb', line 129 def nest_item cardish, ={}, &block = [:nest_name] = Card::Name[cardish].s nest cardish, , &block end |
#view: count ⇒ Object
125 126 127 |
# File 'platypus/tmp/set/gem-defaults/mod002-collection/all/item.rb', line 125 view :count do try :count end |
#voo_items_view ⇒ Object
146 147 148 149 150 |
# File 'platypus/tmp/set/gem-defaults/mod002-collection/all/item.rb', line 146 def voo_items_view return unless voo && (items = voo.items) items[:view] end |
#wrap_item(item, _args = {}) ⇒ Object
181 182 183 |
# File 'platypus/tmp/set/gem-defaults/mod002-collection/all/item.rb', line 181 def wrap_item item, _args={} item # no wrap in base end |