From: Jamal Soueidan Date: 2007-04-02T20:19:10+09:00 Subject: Re: How to use standard library? Sebastian Hungerecker wrote: > Jamal Soueidan wrote: >> > * Query >> > * Fragment >> >> url = URI::split(url) >> p url.host >> >> This doesn't work, host method not found? > > Well, as you said, the split method returns an array. Arrays have no > method > called host, so that's what ruby tells you. > You'd access the host with url[2] because it's the third element in the > array. > > HTH, > Sebastian Ok I got that, why not use hash then if they tell us you got that in return? so it be more readable like this :D uri.host :D -- Posted via http://www.ruby-forum.com/.