Class: Minesweeper::CellState
- Inherits:
-
Object
- Object
- Minesweeper::CellState
- Defined in:
- lib/minesweeper/cell_state.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#status ⇒ Object
Returns the value of attribute status.
-
#view ⇒ Object
Returns the value of attribute view.
Instance Method Summary collapse
-
#initialize(color:, status:, view:) ⇒ CellState
constructor
A new instance of CellState.
- #marked_as_bomb? ⇒ Boolean
- #opened? ⇒ Boolean
Constructor Details
#initialize(color:, status:, view:) ⇒ CellState
Returns a new instance of CellState.
7 8 9 10 11 |
# File 'lib/minesweeper/cell_state.rb', line 7 def initialize(color:, status:, view:) @view = view @color = color @status = status end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
5 6 7 |
# File 'lib/minesweeper/cell_state.rb', line 5 def color @color end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/minesweeper/cell_state.rb', line 5 def status @status end |
#view ⇒ Object
Returns the value of attribute view.
5 6 7 |
# File 'lib/minesweeper/cell_state.rb', line 5 def view @view end |
Instance Method Details
#marked_as_bomb? ⇒ Boolean
17 18 19 |
# File 'lib/minesweeper/cell_state.rb', line 17 def marked_as_bomb? status == :marked_as_bomb end |
#opened? ⇒ Boolean
13 14 15 |
# File 'lib/minesweeper/cell_state.rb', line 13 def opened? status == :opened end |