diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-06-27 11:49:10 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-06-27 11:49:10 +0200 |
commit | 06fe1fe549d6c7dbb643a07a485d24c3e45216d3 (patch) | |
tree | 90947a79c9732a3424b28fd972de06e070e95c53 /lib/edoors/board.rb | |
parent | 2526cd9aef3bb7dc04901be4067dd211f03fe9b5 (diff) | |
parent | 7cfcad744d3e18cbe8a9f71c43a0cad1e8fdd6b4 (diff) | |
download | edoors-ruby-06fe1fe549d6c7dbb643a07a485d24c3e45216d3.zip edoors-ruby-06fe1fe549d6c7dbb643a07a485d24c3e45216d3.tar.gz |
Merge branch 'rewrite0'
Diffstat (limited to 'lib/edoors/board.rb')
-rw-r--r-- | lib/edoors/board.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/edoors/board.rb b/lib/edoors/board.rb index f845dcd..990d312 100644 --- a/lib/edoors/board.rb +++ b/lib/edoors/board.rb @@ -25,11 +25,20 @@ module Edoors # class Board < Door # + # creates a Board object from the arguments. + # + # @param [String] n the name of this Board + # @param [Iota] p the parent + # def initialize n, p super n, p @postponed = {} end # + # called by JSON#generate to serialize the Board object into JSON data + # + # @param [Array] a belongs to JSON generator + # def to_json *a { 'kls' => self.class.name, @@ -38,6 +47,12 @@ module Edoors }.merge(hibernate!).to_json *a end # + # creates a Board object from a JSON data + # + # @param [Hash] o belongs to JSON parser + # + # @raise Edoors::Exception if the json kls attribute is wrong + # def self.json_create o raise Edoors::Exception.new "JSON #{o['kls']} != #{self.name}" if o['kls'] != self.name board = self.new o['name'], o['parent'] @@ -48,6 +63,10 @@ module Edoors board end # + # process the given particle then forward it to user code + # + # @param [Particle] p the Particle to be processed + # def process_p p @viewer.receive_p p if @viewer if p.action!=Edoors::ACT_ERROR |