From: Paul Battley Date: 2006-04-09T17:56:37+09:00 Subject: Re: yield, binding On 09/04/06, Gokhan Ersumer wrote:> so I will be able to write (in DSL part)>> table {> name = "FirstTable"> ...> }>> instead of>> table {|t|> t.name = "FirstTable"> ...> } You can't do 'name =', but if you don't mind a slightly differentsetter syntax, you could use this: class Table def name(new_name=nil) @name = new_name if new_name return @name endend def table(&blk) t = Table.new t.instance_eval(&blk) if block_given? return tend t = table{ name "foo"} p t #=> # Paul.