class Gobstones::Cell

Attributes

black[RW]
blue[RW]
green[RW]
red[RW]

Public Class Methods

new(red: 0, green: 0, blue: 0, black: 0) click to toggle source
# File lib/gobstones/cell.rb, line 5
def initialize(red: 0, green: 0, blue: 0, black: 0)
  @red = red
  @green = green
  @blue = blue
  @black = black
end

Public Instance Methods

==(other) click to toggle source
# File lib/gobstones/cell.rb, line 16
def ==(other)
  self.class === other &&
      other.red == @red &&
      other.green == @green &&
      other.blue == @blue &&
      other.black == @black
end
Also aliased as: eql?
eql?(other)
Alias for: ==
hash() click to toggle source
# File lib/gobstones/cell.rb, line 26
def hash
  @red.hash ^ @green.hash ^ @blue.hash ^ @black.hash
end
set(color, quantity) click to toggle source
# File lib/gobstones/cell.rb, line 12
def set(color, quantity)
  send "#{color}=", quantity
end