lib/card/set/pattern/base.rb in card-1.101.4 vs lib/card/set/pattern/base.rb in card-1.101.5
- old
+ new
@@ -5,20 +5,22 @@
class Base
extend ClassMethods
def initialize card
return if self.class.anchorless?
+
@anchor_name = self.class.anchor_name(card).to_name
@anchor_id = find_anchor_id card
end
def find_anchor_id card
self.class.try(:anchor_id, card) || Card.fetch_id(@anchor_name)
end
def module_key
return @module_key if defined? @module_key
+
@module_key = self.class.module_key anchor_codenames
end
def lookup_module_list modules_hash
module_key && modules_hash[module_key]
@@ -33,11 +35,10 @@
hash && lookup_module_list(hash)
end
def anchor_codenames
anchor_parts.map do |part|
- part_id = Card.fetch_id part
- Card::Codename[part_id] || break
+ part.cardname&.code || break
end
end
def anchor_parts
return [@anchor_name] unless anchor_parts_count > 1