Class: MasterMind::Tobi::GamePlay
- Inherits:
-
Object
- Object
- MasterMind::Tobi::GamePlay
- Defined in:
- lib/mastermind/tobi/gameplay.rb
Instance Attribute Summary collapse
-
#correct_elements ⇒ Object
readonly
Returns the value of attribute correct_elements.
-
#correct_positions ⇒ Object
readonly
Returns the value of attribute correct_positions.
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
Instance Method Summary collapse
-
#initialize(entry, correct_elements, correct_positions) ⇒ GamePlay
constructor
A new instance of GamePlay.
- #to_s ⇒ Object
Constructor Details
#initialize(entry, correct_elements, correct_positions) ⇒ GamePlay
Returns a new instance of GamePlay.
6 7 8 |
# File 'lib/mastermind/tobi/gameplay.rb', line 6 def initialize(entry, correct_elements, correct_positions) @entry = entry; @correct_elements = correct_elements; @correct_positions = correct_positions end |
Instance Attribute Details
#correct_elements ⇒ Object (readonly)
Returns the value of attribute correct_elements.
4 5 6 |
# File 'lib/mastermind/tobi/gameplay.rb', line 4 def correct_elements @correct_elements end |
#correct_positions ⇒ Object (readonly)
Returns the value of attribute correct_positions.
4 5 6 |
# File 'lib/mastermind/tobi/gameplay.rb', line 4 def correct_positions @correct_positions end |
#entry ⇒ Object (readonly)
Returns the value of attribute entry.
4 5 6 |
# File 'lib/mastermind/tobi/gameplay.rb', line 4 def entry @entry end |
Instance Method Details
#to_s ⇒ Object
10 11 12 |
# File 'lib/mastermind/tobi/gameplay.rb', line 10 def to_s "#{entry} ::: #{correct_elements} correct #{correct_elements > 1 ? 'elements' : 'element'} ::: #{correct_positions} in correct #{correct_positions > 1 ? 'positions' : 'position'}" end |