On Wed, Aug 20, 2008 at 5:33 PM, Nick Brown
<ruby-forum.com / nick-brown.com> wrote:
> So the problem doesn't seem to be with sub! at all. It's with cgi.
>
> If I get the variable "a" using the cgi code above, then I create string
> "b":
>
> a = cgi['a']
> b = String.new
>
> a.class
> => String
> b.class
> => String
>
> So they should have the same methods since they are the same class.

>> a = "foo"
=> "foo"
>> def a.definitely_not
>>   "The same"
>> end
=> nil
>> a.definitely_not
=> "The same"
>> a.class
=> String

>> b = "bar"
=> "bar"
>> b.definitely_not
NoMethodError: undefined method `definitely_not' for "bar":String
        from (irb):7
        from :0
>> b.class
=> String

-greg

-- 
Technical Blaag at: http://blog.majesticseacreature.com | Non-tech
stuff at: http://metametta.blogspot.com