Class: FiftyTwo::Suit::Color
- Inherits:
-
Object
- Object
- FiftyTwo::Suit::Color
- Defined in:
- lib/fiftytwo/suit/color.rb
Constant Summary collapse
- ALL =
[ RED = new("red", "ff0000"), BLACK = new("black", "000000") ]
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#rgb ⇒ Object
readonly
Returns the value of attribute rgb.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, rgb) ⇒ Color
constructor
A new instance of Color.
Constructor Details
#initialize(name, rgb) ⇒ Color
Returns a new instance of Color.
8 9 10 11 |
# File 'lib/fiftytwo/suit/color.rb', line 8 def initialize(name, rgb) @name = name @rgb = rgb end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/fiftytwo/suit/color.rb', line 6 def name @name end |
#rgb ⇒ Object (readonly)
Returns the value of attribute rgb.
6 7 8 |
# File 'lib/fiftytwo/suit/color.rb', line 6 def rgb @rgb end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 |
# File 'lib/fiftytwo/suit/color.rb', line 18 def ==(other) name == other.name end |