Module: Wunderground::Resources
- Defined in:
- lib/wunderground/resources.rb
Constant Summary collapse
- RESOURCES =
[ :alerts, :almanac, :astronomy, :conditions, :currenthurricane, :forecast, :forecast10day, :geolookup, :history, :hourly, :hourly10day, :planner, :rawtide, :satellite, :tide, :webcams, :yesterday ]
Class Method Summary collapse
Class Method Details
.method_missing(sym, options = {}) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/wunderground/resources.rb', line 11 def self.method_missing(sym, = {}) queries = sym.to_s.split("_and_").map(&:to_sym) location = Location.new().location raise NoMethodError unless (queries - RESOURCES).empty? JSON.parse Client.get("api/#{Wunderground.api_key}/#{queries.join("/")}/q/#{location}.json").body end |