Module: Card::Set::Abstract::IdList
- Extended by:
- Card::Set
- Defined in:
- platypus/tmp/set/gem-defaults/mod005-list/abstract/id_list.rb
Overview
store items as ids, not names
Constant Summary
Constants included from Helpers
Helpers::SET_PATTERN_TEST_REGEXP
Constants included from Event::Api
Class Method Summary collapse
Instance Method Summary collapse
-
#create_references_out ⇒ Object
override reference creation so there are no referee_keys (referee_keys can screw things up for these cards when things get renamed).
-
#item_ids(args = {}) ⇒ Object
-
#item_names(args = {}) ⇒ Object
-
#pod_content ⇒ Object
-
#replace_references(_old_name, _new_name) ⇒ Object
-
#standardize_item(cardish) ⇒ Object
Methods included from Card::Set
Methods included from I18nScope
Methods included from Registrar
#extended, #finalize_load, #process_base_modules, #register_set
Methods included from Helpers
#format_module, #format_modules, #method_missing, #modules, #pattern_code, #respond_to_missing?, #set_name_parts, #shortname, #underscored_name
Methods included from Card::Set::AdvancedApi
#assign_type, #attachment, #define_set_from_error, #ensure_set, #setting_opts, #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 Trait
#card_accessor, #card_reader, #card_writer, #require_field
Methods included from Event::Api
Class Method Details
.source_location ⇒ Object
8 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/id_list.rb', line 8 def self.source_location; "/Users/ethan/dev/decko/gem/mod/list/set/abstract/id_list.rb"; end |
Instance Method Details
#create_references_out ⇒ Object
override reference creation so there are no referee_keys (referee_keys can screw things up for these cards when things get renamed)
40 41 42 43 44 45 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/id_list.rb', line 40 def create_references_out referee_ids = item_ids return if referee_ids.empty? Reference.mass_insert(referee_ids.map { |rid| [id, rid, "null", "'L'"] }) end |
#item_ids(args = {}) ⇒ Object
19 20 21 22 23 24 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/id_list.rb', line 19 def item_ids args={} item_strings(args).map do |item| item = standardize_item item unless item.match?(/^~/) item.to_s.tr("~", "").to_i end.compact end |
#item_names(args = {}) ⇒ Object
26 27 28 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/id_list.rb', line 26 def item_names args={} item_ids(args).map(&:cardname).compact end |
#pod_content ⇒ Object
30 31 32 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/id_list.rb', line 30 def pod_content item_names.join "\n" end |
#replace_references(_old_name, _new_name) ⇒ Object
34 35 36 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/id_list.rb', line 34 def replace_references _old_name, _new_name # noop end |