Project

General

Profile

Feature #6721

Updated by nobu (Nobuyoshi Nakada) about 3 years ago

=begin
I think the following method is missing from Ruby:

~~~ruby


class Object
def yield_self(*args)
yield(self, *args)
end
end
~~~


I do not know a good use case, but it looks very natural to me. It can be used in method chains.

What do you think? Is there an alternative?
=end

Back