Class: Minesweeper::BombCell

Inherits:
BaseCell show all
Defined in:
lib/minesweeper/bomb_cell.rb

Instance Attribute Summary

Attributes inherited from BaseCell

#state

Instance Method Summary collapse

Methods inherited from BaseCell

#initialize, #toggle_bomb_flag!

Constructor Details

This class inherits a constructor from Minesweeper::BaseCell

Instance Method Details

#bomb?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/minesweeper/bomb_cell.rb', line 5

def bomb?
  true
end

#open!Object



9
10
11
12
13
# File 'lib/minesweeper/bomb_cell.rb', line 9

def open!(*)
  state.view = '*'
  state.color = marked_as_bomb? ? COLOR_WHITE : COLOR_RED
  state.status = :opened
end