In some project i met this code:
erb = yield.src
I can't understan开发者_C百科d what the src
method is doing and how it's possible to chain to yield
method.
Thanks
As far as I understand yield would return an object which has the instance method src defined on it
something like this
def foo
p yield.class
end
foo do
1
end
This will print Fixnum
精彩评论