Module: Card::Set::Type::ListedBy

Extended by:
Card::Set
Defined in:
tmpsets/set/mod016-standard/type/listed_by.rb

Constant Summary

Constants included from Format

Format::TEMPLATE_DIR

Constants included from Event::DelayedEvent

Event::DelayedEvent::DELAY_STAGES

Instance Method Summary collapse

Methods included from I18nScope

#mod_name, #scope

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

#event

Instance Method Details

#generate_contentObject



57
58
59
60
61
# File 'tmpsets/set/mod016-standard/type/listed_by.rb', line 57

def generate_content
  listed_by.map do |item|
    "[[%s]]" % item.to_name.left
  end.join "\n"
end

#list_card(item) ⇒ Object



75
76
77
# File 'tmpsets/set/mod016-standard/type/listed_by.rb', line 75

def list_card item
  Card.fetch item, left.type_name
end

#listed_byObject



63
64
65
66
67
68
69
# File 'tmpsets/set/mod016-standard/type/listed_by.rb', line 63

def listed_by
  Card.search(
    { type: "list", right: trunk.type_name,
      left: { type: cardname.tag }, refer_to: cardname.trunk, return: :name
      }, "listed_by" # better wql comment would be...better
  )
end

#raw_contentObject



51
52
53
54
55
# File 'tmpsets/set/mod016-standard/type/listed_by.rb', line 51

def raw_content
  Card::Cache[Card::Set::Type::ListedBy].fetch(key) do
    generate_content
  end
end

#unfilled?Boolean

Returns:

  • (Boolean)


79
80
81
# File 'tmpsets/set/mod016-standard/type/listed_by.rb', line 79

def unfilled?
  false
end

#update_cached_listObject



71
72
73
# File 'tmpsets/set/mod016-standard/type/listed_by.rb', line 71

def update_cached_list
  Card::Cache[Card::Set::Type::ListedBy].write key, generate_content
end