Sha256: 92552b2ecafb160ead275389db6d81b14ec17aaa9af52e0c77d6ab8c9c92cc2d

Contents?: true

Size: 413 Bytes

Versions: 1

Compression:

Stored size: 413 Bytes

Contents

module GeoNamesAPI
  class Weather < GeoNamesAPI::Object
    
    METHOD = "findNearByWeatherJSON"
    ID = ["lat", "lng"]
    
    def self.where(params={})
      JSON.load(open(url(params)).read)["weatherObservation"]
    end
    
    def self.url(params)
      GeoNamesAPI.url + METHOD + GeoNamesAPI.params.merge(params).to_url
    end

    def initialize(response)
      parse(response)
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
geonames_api-0.0.2 lib/geonames_api/weather.rb