Module: Top4R::ClassUtilMixin::InstanceMethods

Defined in:
lib/top4r/core.rb

Instance Method Summary collapse

Instance Method Details

#initialize(params = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/top4r/core.rb', line 9

def initialize(params = {})
  others = {}
  params.each do |key,val|
    if self.respond_to? key
      self.send("#{key}=", val)
    else
      others[key] = val
    end
  end
  self.send("#{:other_attrs}=", others) if self.respond_to? :other_attrs and others.size > 0
  self.send(:init) if self.respond_to? :init
end