Skip to content

Instantly share code, notes, and snippets.

@jaredatron
Created May 7, 2009 19:18
Show Gist options
  • Select an option

  • Save jaredatron/108291 to your computer and use it in GitHub Desktop.

Select an option

Save jaredatron/108291 to your computer and use it in GitHub Desktop.
class Object
def tell(method, *args)
send(method, *args)
self
end
alias_method :returning_self, :tell
end
puts [[1,2,[1,2]]].compact!.inspect
puts [[1,2,[1,2]]].tell(:compact!).inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment