Class: MineHunt::Cell
- Inherits:
-
Object
- Object
- MineHunt::Cell
- Defined in:
- lib/minehunt.rb
Instance Attribute Summary collapse
-
#mine ⇒ Object
Returns the value of attribute mine.
-
#open ⇒ Object
Returns the value of attribute open.
Instance Method Summary collapse
- #explore ⇒ Object
-
#initialize(mine: false, open: false) ⇒ Cell
constructor
A new instance of Cell.
Constructor Details
#initialize(mine: false, open: false) ⇒ Cell
Returns a new instance of Cell.
11 12 13 14 |
# File 'lib/minehunt.rb', line 11 def initialize( mine: false, open: false ) @mine = mine @open = open end |
Instance Attribute Details
#mine ⇒ Object
Returns the value of attribute mine.
8 9 10 |
# File 'lib/minehunt.rb', line 8 def mine @mine end |
#open ⇒ Object
Returns the value of attribute open.
8 9 10 |
# File 'lib/minehunt.rb', line 8 def open @open end |
Instance Method Details
#explore ⇒ Object
16 17 18 19 20 |
# File 'lib/minehunt.rb', line 16 def explore @open = true @mine end |