Class: MTG::Color

Inherits:
Object
  • Object
show all
Defined in:
lib/mtg/color.rb

Constant Summary collapse

NAMES =

TODO: test

{
  'B' => 'black',
  'G' => 'green',
  'R' => 'red',
  'U' => 'blue',
  'W' => 'white'
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Color

TODO: test



14
15
16
# File 'lib/mtg/color.rb', line 14

def initialize(name)
  self.name = name
end

Instance Attribute Details

#nameObject Also known as: to_s

Returns the value of attribute name.



18
19
20
# File 'lib/mtg/color.rb', line 18

def name
  @name
end

Instance Method Details

#abbrObject

TODO: test



22
23
24
# File 'lib/mtg/color.rb', line 22

def abbr
  NAMES.key(name)
end