title: In a Ruby Class that Inherits from String, How do I Get "#{my_string}" with explicit .to_s
body: <p>In short, I expect all three #{}s in the final line of this test program to result in the same string and they don't.  It works if my class inherits from Object.</p>
  
  <pre><code>&gt; ./test.rb 
  A string foobar, and MyString: , MyString.to_s: foobar
  
  &gt; cat test.rb 
  
      #!/usr/bin/env ruby
  
      class MyString &lt; String
        def initialize s
          @s= s.to_s
          @simple = s.index(?+)
        end
        def to_s() @s end
      end
  
  x='foobar'
  
  puts "A string #{x}, and MyString: #{
          MyString.new(x)}, MyString.to_s: #{MyString.new(x).to_s}"
  </code></pre>