# # default values may be given either directly or as a block which will be # evaluated in the context of self. in both cases (value or block) the # default is set only once and only if needed - it's a lazy evaluation. # require 'attributes' class C attribute :a => 42 attribute(:b){ Float a } end c = C.new p c.a p c.b