有谁知道是否有方法来访问在红宝石块传递参数的名称?红宝石块参数名称
E.g.
def do_something()
# method uses the names of the parameters passed to the block
# in addition to their values
# e.g. the strings "i" and "j"
end
do_something { |i, j| ... }
这是我正在写的一个dsl的要求,而且是一个不寻常的用例。这可能是像parsetree这样的东西,我只是想知道是否有一个更简单/更贴心的方式。
感谢
你为什么要这样做? – Chuck 2009-05-20 09:01:09
我需要访问我正在写的dsl的参数名称。 – fturtle 2009-05-20 09:02:56