From: Martin DeMello Date: 2012-11-24T13:21:09+09:00 Subject: Re: Metaprogramming The code looks fine to me - is there any particular piece you aren't happy with? One improvement I can see is that self.attribute could be def self.attribute(name, params = {}) 1.9.3-p327 :016 > def f(name, params={}) 1.9.3-p327 :017?> p [name, params] 1.9.3-p327 :018?> end => nil 1.9.3-p327 :019 > f('hello') ["hello", {}] => ["hello", {}] 1.9.3-p327 :020 > f('a', :b => true, :c => 'd') ["a", {:b=>true, :c=>"d"}] => ["a", {:b=>true, :c=>"d"}] That will save you the if params check everywhere. martin On Wed, Nov 21, 2012 at 6:19 AM, Aurimas N. wrote: > :DDD Why everybody thinks I do not know anything about ruby? > > I have already figured out the way that I want to do. Here you can look > at it maybe something better you would suggest: > > https://github.com/gcds/libeagle/blob/New-Way/lib/libeagle/base.rb > > -- > Posted via http://www.ruby-forum.com/. >