Module: Card::Set::Type::List
- Extended by:
- Card::Set
- Defined in:
- tmpsets/set/mod016-standard/type/list.rb
Constant Summary
Constants included from Format
Constants included from Event::DelayedEvent
Event::DelayedEvent::DELAY_STAGES
Instance Method Summary collapse
- #item_type ⇒ Object
- #item_type_card ⇒ Object
- #item_type_id ⇒ Object
- #item_type_name ⇒ Object
- #update_all_items ⇒ Object
- #update_listed_by_cache_for(item_keys, args = {}) ⇒ Object
Methods included from I18nScope
Methods included from Loader
#clean_empty_module_from_hash, #clean_empty_modules, #extended, #process_base_modules, #register_set
Methods included from Helpers
#abstract_set?, #all_set?, #num_set_parts, #shortname
Methods included from AdvancedApi
#attachment, #ensure_set, #stage_method
Methods included from Format
#all_set_format_mod!, #define_on_format, #format, #register_set_format, #view
Methods included from Inheritance
#include_set, #include_set_formats
Methods included from Basket
#abstract_basket, #add_to_basket, #basket
Methods included from Card::Set::Trait
#card_accessor, #card_reader, #card_writer
Methods included from Event
Instance Method Details
#item_type ⇒ Object
102 103 104 |
# File 'tmpsets/set/mod016-standard/type/list.rb', line 102 def item_type cardname.right end |
#item_type_card ⇒ Object
110 111 112 |
# File 'tmpsets/set/mod016-standard/type/list.rb', line 110 def item_type_card cardname.right end |
#item_type_id ⇒ Object
114 115 116 |
# File 'tmpsets/set/mod016-standard/type/list.rb', line 114 def item_type_id right.id end |
#item_type_name ⇒ Object
106 107 108 |
# File 'tmpsets/set/mod016-standard/type/list.rb', line 106 def item_type_name cardname.right_name end |
#update_all_items ⇒ Object
78 79 80 81 82 83 84 85 |
# File 'tmpsets/set/mod016-standard/type/list.rb', line 78 def update_all_items current_items = item_keys if db_content_was old_items = item_keys(content: db_content_was) update_listed_by_cache_for old_items end update_listed_by_cache_for current_items end |
#update_listed_by_cache_for(item_keys, args = {}) ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'tmpsets/set/mod016-standard/type/list.rb', line 87 def update_listed_by_cache_for item_keys, args={} type_key = args[:type_key] || left.type_card.key item_keys.each do |item_key| key = "#{item_key}+#{type_key}" next unless Card::Cache[Card::Set::Type::ListedBy].exist? key if (card = Card.fetch(key)) card.update_cached_list card.update_references_out else Card::Cache[Card::Set::Type::ListedBy].delete key end end end |