Skip to content

Instantly share code, notes, and snippets.

@fxn
Created July 30, 2012 10:46
Show Gist options
  • Save fxn/3206147 to your computer and use it in GitHub Desktop.
Save fxn/3206147 to your computer and use it in GitHub Desktop.
o = Object.new
p o
def o.to_s
:foo
end
puts "#{o}"
def o.to_s
"foo"
end
puts "#{o}"
__END__
fxn@yeager:~/tmp $ ruby foo.rb
#<Object:0x007fc2fa108eb0>
#<Object:0x007fc2fa108eb0>
foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment