Class: ReportObject

Inherits:
Object
  • Object
show all
Defined in:
lib/juno-report/report_object.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ ReportObject

Returns a new instance of ReportObject.



2
3
4
5
6
7
8
# File 'lib/juno-report/report_object.rb', line 2

def initialize(hash)
    hash.each do |k,v|
        self.instance_variable_set("@#{k}", v)
        self.class.send(:define_method, k, proc{self.instance_variable_get("@#{k}")})
        self.class.send(:define_method, "#{k}=", proc{|v| self.instance_variable_set("@#{k}", v)})
    end
end