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

Well, where does it identify its module and not a class?

On 4/1/07, Stefano Crocco <stefano.crocco / alice.it> wrote:
>
> Alle domenica 1 aprile 2007, Jamal Soueidan ha scritto:
> > Hello,
> >
> > I'm looking at URI class
> > http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/index.html
> >
> > The interface is somehow confusing?
> >
> > I tried to write
> > url  ri.new
> > url.parse!('http://www.test.com')
> >
> > but this give me error that new does not exist?
> > why cant I use it as a object? is the class static or is there something
> > i misunderstood?
> >
> > In the doc they write that parse method raise URI::InvalidURIError
> > incase a url is incorrect typed.
> >
> > when I try to use it, it doesn't work?
> >
> > begin
> >   #code
> > rescue URI::InvalidURIError
> >   p "wrong url" #this never happens even if the uri is empty?
> > end
> >
> > Thanks for your time and effort :)
> >
> > Regards,
> > Jamal
>
> URI is a module, not a class, so it doesn't have a new method (you can't
> create instances of a module). I've never used URI, so I can't be sure,
> but,
> according to the documentation, you should do:
>
> urlI.parse('http://www.test.com')
>
> I hope this helps
>
> Stefano
>
>

------art_100075_14613190.1175440384360--