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, #pattern_id

Instance Method Summary collapse

Methods inherited from Pattern::Base

#anchor_codenames, #anchor_parts, #anchor_parts_count, #find_anchor_id, #format_module_list, #inspect, #module_key, #module_list, #pattern, #rule_set_key, #safe_key, #to_s

Methods included from Pattern::ClassMethods

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

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