class EAAL::Result::ResultContainer

Result Container class, …

Attributes

attribs[RW]
container[RW]

Public Instance Methods

add_element(key, val) click to toggle source
# File lib/eaal/result.rb, line 24
def add_element(key, val)
    self.container.merge!({key => val})
end
method_missing(method, *args) click to toggle source
# File lib/eaal/result.rb, line 28
def method_missing(method, *args)
    if self.attribs.has_key?(method.id2name)
        self.attribs[method.id2name]
    else
        self.container[method.id2name]
    end
end
to_hash() click to toggle source
# File lib/eaal/result.rb, line 36
def to_hash
    if self.container == {}
        vars = self.instance_variables
        vars.delete_at(0) # delete container var name
        vars.each {|v| self.container[v.to_s.gsub("@","")] = self.instance_variable_get v }
    end
    return self.container.dup
end

Public Class Methods

new() click to toggle source
# File lib/eaal/result.rb, line 19
def initialize
    self.container = {}
    self.attribs = {}
end