Eero Saynatkari wrote:

>Is it possible to change NilClass#to_s to return "nil"
>rather than "" since "" != nil?
>  
>
-- test.rb BEGIN
p nil.to_s.nil?

class NilClass
  def to_s
    nil
  end
end

p nil
p nil.to_s.nil?
-- test.rb END

$ ruby test.rb
false
nil
true


--
Dmitri Priimak