Class: Card::Set::Pattern

Inherits:
Object
  • Object
show all
Defined in:
lib/card/set_pattern.rb

Defined Under Namespace

Classes: Abstract

Class Method Summary collapse

Class Method Details

.card_keysObject



9
10
11
12
13
14
15
# File 'lib/card/set_pattern.rb', line 9

def card_keys
  @card_keys ||=
    Card.set_patterns.each_with_object({}) do |set_pattern, hash|
      card_key = Card.quick_fetch(set_pattern.pattern_code).key
      hash[card_key] = true
    end
end

.find(pattern_code) ⇒ Object



5
6
7
# File 'lib/card/set_pattern.rb', line 5

def find pattern_code
  Card.set_patterns.find { |sub| sub.pattern_code == pattern_code }
end

.in_load_orderObject



17
18
19
20
# File 'lib/card/set_pattern.rb', line 17

def in_load_order
  @in_load_order ||=
    Card.set_patterns.reverse.map(&:pattern_code).unshift :abstract
end