Skip to content

Instantly share code, notes, and snippets.

@jaredatron
Created May 13, 2009 00:17
Show Gist options
  • Select an option

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

Select an option

Save jaredatron/110798 to your computer and use it in GitHub Desktop.
class Puppy < String
def __send__(method, *args, &block)
@called ||= []
@called << method
super
end
attr_reader :called
end
a = Puppy.new('grrrr')
puts a.upcase
puts a.called.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment