Class: Card::Set::Type

Inherits:
Pattern::Base show all
Defined in:
lib/card/set/type.rb

Instance Method Summary collapse

Methods inherited from Pattern::Base

#anchor_codenames, #anchor_parts, #anchor_parts_count, anchorless?, #find_anchor_id, #format_module_list, generic_label, #inspect, junction_only?, module_key, #module_key, #module_list, new, pattern, #pattern, pattern_applies?, register, #rule_set_key, #safe_key, #to_s

Constructor Details

#initialize(card) ⇒ Type

Returns a new instance of Type.



4
5
6
7
8
# File 'lib/card/set/type.rb', line 4

def initialize card
  super
  # support type inheritance
  @inherit_card = card unless module_key
end

Instance Method Details

#lookup_module_list(modules_hash) ⇒ Object



10
11
12
13
# File 'lib/card/set/type.rb', line 10

def lookup_module_list modules_hash
  lookup_key = module_key || inherited_key
  modules_hash[lookup_key] if lookup_key
end