Class: ConnectFourCli::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/connect_four_cli/checker.rb

Direct Known Subclasses

NoChecker

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(color) ⇒ Checker

Returns a new instance of Checker.



8
9
10
# File 'lib/connect_four_cli/checker.rb', line 8

def initialize(color)
  @color = color
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



6
7
8
# File 'lib/connect_four_cli/checker.rb', line 6

def color
  @color
end

Instance Method Details

#==(other_checker) ⇒ Object



12
13
14
# File 'lib/connect_four_cli/checker.rb', line 12

def ==(other_checker)
  color == other_checker.color
end

#checker?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/connect_four_cli/checker.rb', line 20

def checker?
  true
end

#displayObject



16
17
18
# File 'lib/connect_four_cli/checker.rb', line 16

def display
  "O"
end