Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/gatherer_set_parser/card_parser.rb

Instance Method Summary collapse

Instance Method Details

#extract_colorsObject



105
106
107
108
# File 'lib/gatherer_set_parser/card_parser.rb', line 105

def extract_colors
  gsub(/Blue/, 'U').gsub(/Black/, 'B').gsub(/Red/, 'R').gsub(/Green/, 'G').
  gsub(/White/, 'W')
end

#extract_phyrexiaObject



99
100
101
102
103
# File 'lib/gatherer_set_parser/card_parser.rb', line 99

def extract_phyrexia
  gsub(/Phyrexian Blue/, 'U/P').gsub(/Phyrexian Black/, 'B/P').
  gsub(/Phyrexian White/, 'W/P').gsub(/Phyrexian Red/, 'R/P').
  gsub(/Phyrexian Green/, 'G/P')
end

#extract_unique_costsObject



110
111
112
113
# File 'lib/gatherer_set_parser/card_parser.rb', line 110

def extract_unique_costs
  gsub(/Variable Colorless/, 'X').gsub(/Two/, '2').gsub(/or/, '/').
  gsub(/Snow/, 'S').gsub(/Tap/, 'T').gsub(/Untap/, 'Q')
end

#parse_mana_costObject



95
96
97
# File 'lib/gatherer_set_parser/card_parser.rb', line 95

def parse_mana_cost
  extract_phyrexia.extract_colors.extract_unique_costs
end