Class: TTT::Interface::CLI::ComputerPlayer
- Defined in:
- lib/ttt/interface/cli/players.rb
Instance Attribute Summary collapse
-
#computer ⇒ Object
Returns the value of attribute computer.
Attributes inherited from Player
Instance Method Summary collapse
-
#initialize(*args) ⇒ ComputerPlayer
constructor
A new instance of ComputerPlayer.
- #take_turn ⇒ Object
Constructor Details
#initialize(*args) ⇒ ComputerPlayer
Returns a new instance of ComputerPlayer.
25 26 27 28 |
# File 'lib/ttt/interface/cli/players.rb', line 25 def initialize(*args) super self.computer = TTT::ComputerPlayer.new game end |
Instance Attribute Details
#computer ⇒ Object
Returns the value of attribute computer.
24 25 26 |
# File 'lib/ttt/interface/cli/players.rb', line 24 def computer @computer end |
Instance Method Details
#take_turn ⇒ Object
29 30 31 |
# File 'lib/ttt/interface/cli/players.rb', line 29 def take_turn computer.take_turn end |