Created
October 20, 2013 05:59
-
-
Save kyuden/7065496 to your computer and use it in GitHub Desktop.
inspect vs to_s
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
class Test | |
def initialize | |
@a = Array.new | |
@b = Array.new | |
end | |
def to_s | |
"call to_s" | |
end | |
def inspect | |
"call inspect" | |
end | |
end | |
if __FILE__ == $0 | |
test = Test.new | |
p test | |
print test | |
puts test | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment