Class: Cell
- Inherits:
-
Object
- Object
- Cell
- Defined in:
- lib/life/cell.rb
Instance Method Summary collapse
- #dead? ⇒ Boolean
-
#initialize(live) ⇒ Cell
constructor
A new instance of Cell.
- #kill ⇒ Object
- #live ⇒ Object
- #live? ⇒ Boolean
Constructor Details
#initialize(live) ⇒ Cell
Returns a new instance of Cell.
3 4 5 |
# File 'lib/life/cell.rb', line 3 def initialize(live) @live = live end |
Instance Method Details
#dead? ⇒ Boolean
11 12 13 |
# File 'lib/life/cell.rb', line 11 def dead? !@live end |
#kill ⇒ Object
19 20 21 |
# File 'lib/life/cell.rb', line 19 def kill @live = false end |
#live ⇒ Object
15 16 17 |
# File 'lib/life/cell.rb', line 15 def live @live = true end |
#live? ⇒ Boolean
7 8 9 |
# File 'lib/life/cell.rb', line 7 def live? @live end |