From: 12 34 Date: 2010-06-02T15:30:54+09:00 Subject: Re: Parsing geonames Michael Fellinger wrote: > On Wed, Jun 2, 2010 at 2:57 PM, 12 34 wrote: >> 41.505928,-81.594582 > > iota ~ % irb >>> require 'geonames' > => true >>> places = Geonames::WebService.find_nearby_place_name(41.505928, -81.594582) > => [# @alternate_names=nil, @latitude=41.5089406, @longitude=-81.5981817, > @geoname_id="5161005", @country_code="US", @country_name="United > States", @feature_class="P", @feature_code="PPLX", > @feature_class_name=nil, @feature_code_name=nil, @population=nil, > @elevation=nil, @distance=0.4495>] >>> places.first.country_name > => "United States" Thanks. I had tried places.country_name among others. Why the "first"? places_nearby[0].country_code works too. The docs didn't suggest how to parse the result. Thank you for the answers, but I'm not sure why it's working. But I can proceed. -- Posted via http://www.ruby-forum.com/.