Class: ConnectFourCli::Checker
- Inherits:
-
Object
- Object
- ConnectFourCli::Checker
- Defined in:
- lib/connect_four_cli/checker.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
Instance Method Summary collapse
- #==(other_checker) ⇒ Object
- #checker? ⇒ Boolean
- #display ⇒ Object
-
#initialize(color) ⇒ Checker
constructor
A new instance of Checker.
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
#color ⇒ Object (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
20 21 22 |
# File 'lib/connect_four_cli/checker.rb', line 20 def checker? true end |
#display ⇒ Object
16 17 18 |
# File 'lib/connect_four_cli/checker.rb', line 16 def display "O" end |