Ruby method that returns itself

Yes! If you have Ruby 2.2.0 or later, you can use the Kernel#itself method.

You can see the extensive discussion of this feature here: https://bugs.ruby-lang.org/issues/6373. The patch was submitted by Rafael França in message #53.

You can see it in the official Ruby source by looking in object.c.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)