summaryrefslogtreecommitdiffstats
path: root/lib/evendoors
diff options
context:
space:
mode:
Diffstat (limited to 'lib/evendoors')
-rw-r--r--lib/evendoors/board.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/evendoors/board.rb b/lib/evendoors/board.rb
index ead1012..b9b01cd 100644
--- a/lib/evendoors/board.rb
+++ b/lib/evendoors/board.rb
@@ -11,6 +11,23 @@ module EvenDoors
@postponed = {}
end
#
+ def to_json *a
+ {
+ 'kls' => self.class.name,
+ 'name' => @name,
+ 'postponed' => @postponed
+ }.to_json *a
+ end
+ #
+ def self.json_create o
+ raise EvenDoors::Exception.new "JSON #{o['kls']} != #{self.name}" if o['kls'] != self.name
+ board = self.new o['name']
+ o['postponed'].each do |lv,p|
+ board.process_p EvenDoors::Particle.json_create p
+ end
+ board
+ end
+ #
def process_p p
@viewer.receive_p p if @viewer
if p.action!=EvenDoors::ACT_ERROR