lib/qreport/initialization.rb in qreport-0.0.3 vs lib/qreport/initialization.rb in qreport-0.0.6

- old
+ new

@@ -3,12 +3,19 @@ module Qreport module Initialization def initialize opts = nil opts ||= EMPTY_Hash initialize_before_opts if respond_to? :initialize_before_opts - opts.each do | k, v | - send(:"#{k}=", v) - end + initialize_from_hash! opts initialize_after_opts if respond_to? :initialize_after_opts + end + + def initialize_from_hash! opts + if opts + opts.each do | k, v | + send(:"#{k}=", v) + end + end + self end end end