Module: Card::Set::Type::List
- Extended by:
- Card::Set
- Defined in:
- tmpsets/set/mod021-standard/type/list.rb
Overview
Set: All "List" cards
Class Method Summary collapse
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, #underscore
Methods included from AdvancedApi
#attachment, #ensure_set, #stage_method
Methods included from Format
#before, #format, layout_method_name, #view, view_method_name, view_setting_method_name, wrapper_method_name
Methods included from Inheritance
#include_set, #include_set_formats
Methods included from Basket
#abstract_basket, #add_to_basket, #basket, #unshift_basket
Methods included from Card::Set::Trait
#card_accessor, #card_reader, #card_writer, #require_field
Methods included from Event::Api
Class Method Details
.source_location ⇒ Object
7 |
# File 'tmpsets/set/mod021-standard/type/list.rb', line 7 def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/standard/set/type/list.rb"; end |
Instance Method Details
#item_type ⇒ Object
105 106 107 |
# File 'tmpsets/set/mod021-standard/type/list.rb', line 105 def item_type name.right end |
#item_type_card ⇒ Object
113 114 115 |
# File 'tmpsets/set/mod021-standard/type/list.rb', line 113 def item_type_card name.right end |
#item_type_id ⇒ Object
117 118 119 |
# File 'tmpsets/set/mod021-standard/type/list.rb', line 117 def item_type_id right.id end |
#item_type_name ⇒ Object
109 110 111 |
# File 'tmpsets/set/mod021-standard/type/list.rb', line 109 def item_type_name name.right_name end |
#update_all_items ⇒ Object
80 81 82 83 84 85 86 87 |
# File 'tmpsets/set/mod021-standard/type/list.rb', line 80 def update_all_items current_items = item_keys if db_content_before_act old_items = item_keys(content: db_content_before_act) 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
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'tmpsets/set/mod021-standard/type/list.rb', line 89 def update_listed_by_cache_for item_keys, args={} type_key = args[:type_key] || left&.type_card&.key return unless type_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.left card.update_cached_list card.update_references_out else Card::Cache[Card::Set::Type::ListedBy].delete key end end end |