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)
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/id_list.rb', line 42 def create_references_out referee_ids = item_ids return if referee_ids.empty? values = referee_ids.each_with_object([]) do |rid, vals| vals << { referer_id: id, referee_id: rid, referee_key: nil, ref_type: "L" } end Reference.insert_in_slices values end |
#item_ids(args = {}) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/id_list.rb', line 19 def item_ids args={} seeding_ids do item_strings(args).map do |item| item = standardize_item item unless item.match?(/^~/) item&.to_s&.tr("~", "")&.to_i end.compact end end |
#item_names(args = {}) ⇒ Object
28 29 30 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/id_list.rb', line 28 def item_names args={} item_ids(args).map(&:cardname).compact end |
#pod_content ⇒ Object
32 33 34 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/id_list.rb', line 32 def pod_content item_names.join "\n" end |
#replace_references(_old_name, _new_name) ⇒ Object
36 37 38 |
# File 'platypus/tmp/set/gem-defaults/mod005-list/abstract/id_list.rb', line 36 def replace_references _old_name, _new_name # noop end |