From e29b965e1ffbb06f26443028c1ac38f1de4f046e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 26 Jun 2012 16:51:43 +0200 Subject: Board: add yard documentation --- lib/edoors/board.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 -- cgit v1.1-2-g2b99