Class: Lifelike::LifelikeCellularAutomaton::WorldSerializer
- Inherits:
-
Object
- Object
- Lifelike::LifelikeCellularAutomaton::WorldSerializer
- Defined in:
- lib/lifelike/lifelike_cellular_automaton/world_serializer.rb
Instance Method Summary collapse
- #dump(world) ⇒ Object
-
#initialize(cell_serializer) ⇒ WorldSerializer
constructor
A new instance of WorldSerializer.
- #load(string) ⇒ Object
Constructor Details
#initialize(cell_serializer) ⇒ WorldSerializer
Returns a new instance of WorldSerializer.
4 5 6 |
# File 'lib/lifelike/lifelike_cellular_automaton/world_serializer.rb', line 4 def initialize(cell_serializer) @cell_serializer = cell_serializer end |
Instance Method Details
#dump(world) ⇒ Object
12 13 14 |
# File 'lib/lifelike/lifelike_cellular_automaton/world_serializer.rb', line 12 def dump(world) cell_grid_to_string(world.cell_grid) end |