T
Tomasz Wegrzanowski
Hello,
Just wondering, with eval "def ..." I can do:
eval "def #{tag}(*args, &blk) xml#{tag}, *args, &blk) end"
Of course it would be nicer to do:
define_method(tag) {|*args,&blk|, xml(tag, *args, &blk) }
But that throws a parse error.
Is there some way to define method that takes a block argument
without calling eval ?
Just wondering, with eval "def ..." I can do:
eval "def #{tag}(*args, &blk) xml#{tag}, *args, &blk) end"
Of course it would be nicer to do:
define_method(tag) {|*args,&blk|, xml(tag, *args, &blk) }
But that throws a parse error.
Is there some way to define method that takes a block argument
without calling eval ?