Class: Minesweeper::Cells::Bomb

Inherits:
Base
  • Object
show all
Defined in:
lib/minesweeper/cells/bomb.rb

Instance Attribute Summary

Attributes inherited from Base

#state

Instance Method Summary collapse

Methods inherited from Base

#initialize, #toggle_bomb_flag!

Constructor Details

This class inherits a constructor from Minesweeper::Cells::Base

Instance Method Details

#bomb?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/minesweeper/cells/bomb.rb', line 6

def bomb?
  true
end

#open!Object



10
11
12
13
14
# File 'lib/minesweeper/cells/bomb.rb', line 10

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