Class: Conwy::World
- Inherits:
-
Object
- Object
- Conwy::World
- Defined in:
- lib/conwy/world.rb
Defined Under Namespace
Classes: CellGrid
Instance Method Summary collapse
-
#initialize(cell_string) ⇒ World
constructor
A new instance of World.
- #next ⇒ Object
- #to_s ⇒ Object
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
#next ⇒ Object
11 12 13 |
# File 'lib/conwy/world.rb', line 11 def next self.class.new(cell_grid.next.to_s) end |
#to_s ⇒ Object
7 8 9 |
# File 'lib/conwy/world.rb', line 7 def to_s cell_grid.to_s end |