Skip to content

Instantly share code, notes, and snippets.

@domgetter
Created July 23, 2014 02:19
Show Gist options
  • Save domgetter/e6fbf024636867422739 to your computer and use it in GitHub Desktop.
Save domgetter/e6fbf024636867422739 to your computer and use it in GitHub Desktop.
# here's what Array would output from inspect if it wasn't overridden:
class Array
def inspect
"<##{self.class}:" + "0" + "x" + "#{self.object_id.to_s(16)}>"
end
end
[1,2,3].inspect
=> "<#Array:0x1491570>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment