corey konrad wrote:
> irb(main):041:1>   puts "this is a better number" + i_num
> ...
> TypeError: can't convert Fixnum into String
> 	from (irb):41:in `+'
> 	from (irb):41:in `favorite_number'
> 	from (irb):43
> 	from :0

This happens because String#+ call #to_str on its argument -- so when 
you're using `+' to concatenate a string and another object, that object 
has to respond to #to_str, and not just #to_s.

   class Numeric
     # this isn't recommended, though
     def to_str
       to_s
     end
   end

   "foo " + 4           => "foo 4"
   "foo " + 4 + " bar"  => "foo 4 bar"

In reality, all you need to do is this:

   "this is a better number #{i_num}"

When you use the `#{...}' syntax inside a double-quoted (!) string, 
#to_s is called on the expression -- and most objects respond to that.


Cheers,
Daniel