P
Patrick Li
Hi,
I'm having a hard time spotting my bug in this code.
When it runs it gives me:
uninitialized constant String::StringIO (NameError)
Am I missing something? StringIO is a global constant. Why can't ruby
find it?
class String
def self.fromURL(string)
string = string.string if string.is_a?(StringIO)
CGI.unescape(string)
end
end
Thanks a lot for your help
-Patrick
I'm having a hard time spotting my bug in this code.
When it runs it gives me:
uninitialized constant String::StringIO (NameError)
Am I missing something? StringIO is a global constant. Why can't ruby
find it?
class String
def self.fromURL(string)
string = string.string if string.is_a?(StringIO)
CGI.unescape(string)
end
end
Thanks a lot for your help
-Patrick