Class: Minesweeper::Cells::State
- Inherits:
-
Object
- Object
- Minesweeper::Cells::State
- Defined in:
- lib/minesweeper/cells/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:) ⇒ State
constructor
A new instance of State.
- #marked_as_bomb? ⇒ Boolean
- #opened? ⇒ Boolean
Constructor Details
#initialize(color:, status:, view:) ⇒ State
Returns a new instance of State.
8 9 10 11 12 |
# File 'lib/minesweeper/cells/state.rb', line 8 def initialize(color:, status:, view:) @view = view @color = color @status = status end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
6 7 8 |
# File 'lib/minesweeper/cells/state.rb', line 6 def color @color end |
#status ⇒ Object
Returns the value of attribute status.
6 7 8 |
# File 'lib/minesweeper/cells/state.rb', line 6 def status @status end |
#view ⇒ Object
Returns the value of attribute view.
6 7 8 |
# File 'lib/minesweeper/cells/state.rb', line 6 def view @view end |
Instance Method Details
#marked_as_bomb? ⇒ Boolean
18 19 20 |
# File 'lib/minesweeper/cells/state.rb', line 18 def marked_as_bomb? status == :marked_as_bomb end |
#opened? ⇒ Boolean
14 15 16 |
# File 'lib/minesweeper/cells/state.rb', line 14 def opened? status == :opened end |