我想知道是否有人(比如我自己=])可以创建一些方法来做这样的事情:
x = magic_method do
create_string "some_string" # a method that returns "This is <some string>\n "
create_string "other_string"
create_string "third_string"
end
然后会返回
puts x #=> This is some_string\n This is other_string\n This is third_string