From: Andrew Vit Date: 2014-04-14T11:11:20-07:00 Subject: [ruby-core:62025] Re: Question about Ruby Arrays On 14-04-14, 10:06, Mohamed Dokmak wrote: > I need ideas on implementing a hook that enables me to know when Ruby > uses a method dispatch such as arr.reverse! and return the same > reference to the object ? Why not overload the method directly and call super? ``` class Array def reverse! $LOGGER.warn "called #{__method__} on #{self.inspect}" super end end ``` I can't think of any way to select all of the ruby methods that return "self". Andrew Vit