Created
July 23, 2014 02:19
-
-
Save domgetter/e6fbf024636867422739 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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