Class: Conwy::World

Inherits:
Object
  • Object
show all
Defined in:
lib/conwy/world.rb

Defined Under Namespace

Classes: CellGrid

Instance Method Summary collapse

Constructor Details

#initialize(cell_string) ⇒ World

Returns a new instance of World.



3
4
5
# File 'lib/conwy/world.rb', line 3

def initialize(cell_string)
  @cell_grid = CellGrid.from_s(cell_string)
end

Instance Method Details

#nextObject



11
12
13
# File 'lib/conwy/world.rb', line 11

def next
  self.class.new(cell_grid.next.to_s)
end

#to_sObject



7
8
9
# File 'lib/conwy/world.rb', line 7

def to_s
  cell_grid.to_s
end