------art_100139_20207288.1175440533739
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Yes I understand that its module now :)

But how can I see its module, I can see this:

Module URI::Escape<http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/Escape.html>
Module URI::REGEXP<http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/REGEXP.html>
Class URI::BadURIError<http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/BadURIError.html>
Class URI::Error<http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/Error.html>
Class URI::FTP<http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/FTP.html>
Class URI::Generic<http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/Generic.html>
Class URI::HTTP<http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/HTTP.html>
Class URI::HTTPS<http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/HTTPS.html>
Class URI::InvalidComponentError<http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/InvalidComponentError.html>
Class URI::InvalidURIError<http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/InvalidURIError.html>
Class URI::LDAP<http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/LDAP.html>
Class URI::MailTo<http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/MailTo.html>

I thought I would use URI:HTTP ?

Another little thing is it does not throw any exceptions as mentioned in the
doc?


On 4/1/07, Michael T. Richter <ttmrichter / gmail.com> wrote:
>
>  On Sun, 2007-01-04 at 20:42 +0900, Jamal Soueidan wrote:
>
> I'm looking at URI classhttp://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/index.html
> The interface is somehow confusing?
> I tried to writeurl  ri.newurl.parse!('http://www.test.com')
> but this give me error that new does not exist?
>
>
> To me it looks like "uri" doesn't exist:
>
> irb(main):007:0> require 'uri'trueirb(main):008:0> url  ri.newNameError: undefined local variable or method `uri' for main:Object        from (irb):8        from /usr/lib/ruby/1.8/uri/http.rb:56
>
>
> Glancing at the page you posted, I see there that there is no object
> called "uri" anywhere.  There is a *module* called "URI" and it has a
> parse method, but there isn't a class you can instantiate.  What's returned
> from that method (there also doesn't appear to be a "parse!" method anywhere
> on that page) looks like it's one of the URI::<something> classes for each
> specific protocol like URI::HTTP and the like.
>
> irb(main):009:0> URI.parse("http://www.booger.com")#<URI::HTTP:0xfdbe7c2fe URL:http://www.booger.com>
>
>
>   --
> *Michael T. Richter* <ttmrichter / gmail.com> (*GoogleTalk:*
> ttmrichter / gmail.com)
> *All really first class designers are both artists, engineers, and men of
> a powerful and intolerant temper, quick to resist the least modification of
> the plans, energetic in fighting the least infringement upon what they
> regard as their own sphere of action. (Nevil Shute)*
>
>

------art_100139_20207288.1175440533739--