Module: Barometer::WeatherService

Defined in:
lib/barometer/weather_service.rb,
lib/barometer/weather_services/base.rb,
lib/barometer/weather_services/response.rb,
lib/barometer/weather_services/wunderground_v1.rb,
lib/barometer/weather_services/response/location.rb,
lib/barometer/weather_services/response/time_zone.rb,
lib/barometer/weather_services/wunderground_v1/query.rb,
lib/barometer/weather_services/wunderground_v1/current_api.rb,
lib/barometer/weather_services/wunderground_v1/response/sun.rb,
lib/barometer/weather_services/wunderground_v1/forecast_api.rb,
lib/barometer/weather_services/wunderground_v1/response/station.rb,
lib/barometer/weather_services/wunderground_v1/current_response.rb,
lib/barometer/weather_services/wunderground_v1/response/location.rb,
lib/barometer/weather_services/wunderground_v1/response/timezone.rb,
lib/barometer/weather_services/wunderground_v1/forecast_response.rb,
lib/barometer/weather_services/wunderground_v1/response/full_timezone.rb,
lib/barometer/weather_services/wunderground_v1/response/current_weather.rb,
lib/barometer/weather_services/wunderground_v1/response/forecasted_weather.rb

Defined Under Namespace

Modules: Response Classes: Base, KeyRequired, NotFound, WundergroundV1

Class Method Summary (collapse)

Class Method Details

+ (Object) new(*args)



28
29
30
# File 'lib/barometer/weather_service.rb', line 28

def self.new(*args)
  Base.new(*args)
end

+ (Object) register(key, *args, &block)



14
15
16
17
18
19
20
21
22
# File 'lib/barometer/weather_service.rb', line 14

def self.register(key, *args, &block)
  if block_given?
    services.register(key, *args, &block)
  elsif args.size > 0
    services.register(key, *args)
  else
    raise ArgumentError
  end
end

+ (Object) services



10
11
12
# File 'lib/barometer/weather_service.rb', line 10

def self.services
  @@services ||= Utils::VersionedRegistration.new
end

+ (Object) services=(services)



6
7
8
# File 'lib/barometer/weather_service.rb', line 6

def self.services=(services)
  @@services = services
end

+ (Object) source(key, version = nil)



24
25
26
# File 'lib/barometer/weather_service.rb', line 24

def self.source(key, version=nil)
  services.find(key, version) or raise NotFound
end