Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.
MtnBiker edited this page Sep 13, 2010 · 4 revisions

Welcome to the ruby-geonames wiki!
Look at [this ruby-forum discussion[http://www.ruby-forum.com/topic/210822]] for hints on how to use this gem.

Try

places = Geonames::WebService.find_nearby_place_name(41.505928, -81.594582)
=> [#<Geonames::Toponym:0×000000027dd158 @name=“Little Italy”,
@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”

and

places_nearby.class
places_nearby0
places_nearby.size
places_nearby0.class
places_nearby0.methods
places_nearby.each_with_index{|x,i| puts"#{i}) #{x}"}

Clone this wiki locally