Class: Mastermind::Game::Turn
- Inherits:
-
Object
- Object
- Mastermind::Game::Turn
- Defined in:
- lib/mastermind/game/turn.rb
Instance Attribute Summary collapse
-
#exact ⇒ Object
readonly
Returns the value of attribute exact.
-
#guess ⇒ Object
readonly
Returns the value of attribute guess.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#partial ⇒ Object
readonly
Returns the value of attribute partial.
Instance Method Summary collapse
-
#initialize(guess:, number:, exact: 0, partial: 0) ⇒ Turn
constructor
A new instance of Turn.
Constructor Details
#initialize(guess:, number:, exact: 0, partial: 0) ⇒ Turn
Returns a new instance of Turn.
6 7 8 9 10 11 |
# File 'lib/mastermind/game/turn.rb', line 6 def initialize(guess:, number:, exact: 0, partial: 0) @guess = guess @exact = exact @partial = partial @number = number end |
Instance Attribute Details
#exact ⇒ Object (readonly)
Returns the value of attribute exact.
4 5 6 |
# File 'lib/mastermind/game/turn.rb', line 4 def exact @exact end |
#guess ⇒ Object (readonly)
Returns the value of attribute guess.
4 5 6 |
# File 'lib/mastermind/game/turn.rb', line 4 def guess @guess end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
4 5 6 |
# File 'lib/mastermind/game/turn.rb', line 4 def number @number end |
#partial ⇒ Object (readonly)
Returns the value of attribute partial.
4 5 6 |
# File 'lib/mastermind/game/turn.rb', line 4 def partial @partial end |