Reputation: 21791
In some project i met this code:
erb = yield.src
I can't understand what the src
method is doing and how it's possible to chain to yield
method.
Thanks
Upvotes: 1
Views: 220
Reputation: 8412
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
Upvotes: 1