Class: BasicObject
- Defined in:
- lib/smart_constructor.rb
Instance Method Summary collapse
Instance Method Details
#init(*args, &block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/smart_constructor.rb', line 5 def init(*args, &block) args.each do |single| single.each do |name, val| name = "@#{name}" instance_variable_set("#{name}", val) end end if block_given? then instance_eval(&block) end end |