Class: Card::Set::Pattern
- Inherits:
-
Object
- Object
- Card::Set::Pattern
show all
- Defined in:
- lib/card/set/pattern.rb,
lib/card/set/pattern/all.rb,
lib/card/set/pattern/base.rb,
lib/card/set/pattern/class_methods.rb
Defined Under Namespace
Modules: All, ClassMethods
Classes: Base
Class Method Summary
collapse
Class Method Details
.card_keys ⇒ Object
27
28
29
30
31
32
33
|
# File 'lib/card/set/pattern.rb', line 27
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
23
24
25
|
# File 'lib/card/set/pattern.rb', line 23
def find pattern_code
Card.set_patterns.find { |sub| sub.pattern_code == pattern_code }
end
|
.loadable_codes ⇒ Object
41
42
43
|
# File 'lib/card/set/pattern.rb', line 41
def loadable_codes
Card.set_patterns.map(&:pattern_code).push(:abstract).reverse
end
|
.loadables ⇒ Object
13
14
15
|
# File 'lib/card/set/pattern.rb', line 13
def loadables
Card.set_patterns.push(Card::Set::Abstract).reverse
end
|
.nonbase_loadable_codes ⇒ Object
35
36
37
38
39
|
# File 'lib/card/set/pattern.rb', line 35
def nonbase_loadable_codes
l = loadable_codes
l.delete :all
l
end
|
.nonbase_loadables ⇒ Object
17
18
19
20
21
|
# File 'lib/card/set/pattern.rb', line 17
def nonbase_loadables
l = loadables
l.delete Card::Set::All
l
end
|
.reset ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/card/set/pattern.rb', line 5
def reset
nonbase_loadables.each do |set_pattern|
Card::Set.const_remove_if_defined set_pattern.to_s.split("::").last
end
Card.set_patterns = []
@card_keys = nil
end
|