public
Last active

Non-obvious string interpolation tidbit.

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12
class Foo
def to_s
1
end
 
# Just to make sure ;)
def inspect
'a foo'
end
end
 
p "This is a foo: #{Foo.new}!"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.