Class: MineHunt::Cell

Inherits:
Object
  • Object
show all
Defined in:
lib/minehunt.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#mineObject

Returns the value of attribute mine.



8
9
10
# File 'lib/minehunt.rb', line 8

def mine
  @mine
end

#openObject

Returns the value of attribute open.



8
9
10
# File 'lib/minehunt.rb', line 8

def open
  @open
end

Instance Method Details

#exploreObject



16
17
18
19
20
# File 'lib/minehunt.rb', line 16

def explore
  @open = true

  @mine
end