Skip to content

Instantly share code, notes, and snippets.

@kyuden
Created October 20, 2013 05:59
Show Gist options
  • Save kyuden/7065496 to your computer and use it in GitHub Desktop.
Save kyuden/7065496 to your computer and use it in GitHub Desktop.
inspect vs to_s
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