Class: Cell

Inherits:
Object
  • Object
show all
Defined in:
lib/life/cell.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


11
12
13
# File 'lib/life/cell.rb', line 11

def dead?
  !@live
end

#killObject



19
20
21
# File 'lib/life/cell.rb', line 19

def kill
  @live = false
end

#liveObject



15
16
17
# File 'lib/life/cell.rb', line 15

def live
  @live = true
end

#live?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/life/cell.rb', line 7

def live?
  @live
end