Method: CloudMade::GeoResults#initialize
- Defined in:
- lib/cloudmade/geocoding.rb
#initialize(data) ⇒ GeoResults
Returns a new instance of GeoResults.
100 101 102 103 104 105 106 |
# File 'lib/cloudmade/geocoding.rb', line 100 def initialize(data) self.found = Integer(data['found']) if data.has_key? 'found' if (data['features'] != nil) then self.results = data['features'].map { |feature_data| CloudMade::GeoResult.new(feature_data) } end self.bounds = CloudMade::BBox.from_coordinates(data['bounds']) if data.has_key? 'bounds' end |