Hi,
I'm experimenting with Ruby by writing some kind of DSL.
I wonder if It is possible calling given block to a proc with different
binding
What I'm trying to achieve is something like this
class Table
attr_accessor :name,
def getBinding
binding
end
end
def table
t = Table.new
if block_given?
yield # with t.getBinding
end
t
end
so I will be able to write (in DSL part)
table {
name = "FirstTable"
...
}
instead of
table {|t|
t.name = "FirstTable"
...
}
Thanks
Gokhan Ersumer
--
Posted via http://www.ruby-forum.com/.