Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/gatherer_set_parser/card_parser.rb
Instance Method Summary collapse
- #extract_colors ⇒ Object
- #extract_phyrexia ⇒ Object
- #extract_unique_costs ⇒ Object
- #parse_mana_cost ⇒ Object
Instance Method Details
#extract_colors ⇒ Object
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_phyrexia ⇒ Object
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_costs ⇒ Object
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_cost ⇒ Object
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 |