Class: Card::Set::Type

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

Instance Attribute Summary

Attributes included from Pattern::ClassMethods

#anchor_parts_count, #anchorless, #assigns_type, #junction_only, #pattern_code

Instance Method Summary collapse

Methods inherited from Pattern::Base

#anchor_codenames, #anchor_parts, #find_anchor_id, #format_module_list, #inspect, #module_key, #module_list, #rule_lookup_key, #safe_key, #to_s

Methods included from Pattern::ClassMethods

#anchorless?, #generic_label, #junction_only?, #module_key, #new, #pattern, #pattern_applies?, #pattern_id, #register

Constructor Details

#initialize(card) ⇒ Type

Returns a new instance of Type.



7
8
9
10
11
# File 'lib/card/set/type.rb', line 7

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

Instance Method Details

#lookup_module_list(modules_hash) ⇒ Object



13
14
15
16
# File 'lib/card/set/type.rb', line 13

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