Module: Barometer

Defined in:
lib/barometer.rb,
lib/barometer/base.rb,
lib/barometer/query.rb,
lib/barometer/weather.rb,
lib/barometer/data/geo.rb,
lib/barometer/data/sun.rb,
lib/barometer/data/zone.rb,
lib/barometer/data/night.rb,
lib/barometer/data/speed.rb,
lib/barometer/data/units.rb,
lib/barometer/data/current.rb,
lib/barometer/formats/icao.rb,
lib/barometer/data/distance.rb,
lib/barometer/data/forecast.rb,
lib/barometer/data/location.rb,
lib/barometer/data/pressure.rb,
lib/barometer/formats/format.rb,
lib/barometer/data/local_time.rb,
lib/barometer/formats/geocode.rb,
lib/barometer/formats/zipcode.rb,
lib/barometer/data/measurement.rb,
lib/barometer/data/temperature.rb,
lib/barometer/formats/postalcode.rb,
lib/barometer/formats/weather_id.rb,
lib/barometer/data/local_datetime.rb,
lib/barometer/formats/coordinates.rb,
lib/barometer/web_services/geocode.rb,
lib/barometer/formats/short_zipcode.rb,
lib/barometer/weather_services/noaa.rb,
lib/barometer/weather_services/yahoo.rb,
lib/barometer/weather_services/google.rb,
lib/barometer/web_services/weather_id.rb,
lib/barometer/weather_services/service.rb,
lib/barometer/web_services/web_service.rb,
lib/barometer/weather_services/weather_bug.rb,
lib/barometer/weather_services/wunderground.rb,
lib/barometer/weather_services/weather_dot_com.rb

Defined Under Namespace

Classes: Base, OutOfSources, Query, Weather, WeatherService, WebService

Constant Summary collapse

@@google_geocode_key =
nil
@@force_geocode =

sometimes a query is used as is and never gets geocoded (ie zipcode) often, it is useful to have queries geocoded to know where in the world that query points to. you can force the geocoding of queries (even when not required) so that you have the geocoded data. the reason this isn't the default is that it will use an extra web service query when not normally required

false
@@timeout =

adjust the timeout used when interactind with external web services

15

Class Method Summary collapse

Class Method Details

.config=(config = nil) ⇒ Object

update the Barometer configuration



40
41
42
# File 'lib/barometer.rb', line 40

def self.config=(config=nil)
  Barometer::Base.config = config
end

.force_geocode ⇒ Object



24
# File 'lib/barometer.rb', line 24

def self.force_geocode; @@force_geocode; end

.force_geocode! ⇒ Object



26
# File 'lib/barometer.rb', line 26

def self.force_geocode!; @@force_geocode = true; end

.force_geocode=(value) ⇒ Object



25
# File 'lib/barometer.rb', line 25

def self.force_geocode=(value); @@force_geocode = value; end

.google_geocode_key ⇒ Object



13
# File 'lib/barometer.rb', line 13

def self.google_geocode_key; @@google_geocode_key; end

.google_geocode_key=(key) ⇒ Object



14
# File 'lib/barometer.rb', line 14

def self.google_geocode_key=(key); @@google_geocode_key = key; end

.new(query = nil) ⇒ Object



34
35
36
# File 'lib/barometer.rb', line 34

def self.new(query=nil)
  Barometer::Base.new(query)
end

.source(source) ⇒ Object

shortcut to Barometer::Service.source method allows Barometer.source(:wunderground)



47
48
49
# File 'lib/barometer.rb', line 47

def self.source(source)
  Barometer::WeatherService.source(source)
end

.timeout ⇒ Object



31
# File 'lib/barometer.rb', line 31

def self.timeout; @@timeout; end

.timeout=(value) ⇒ Object



32
# File 'lib/barometer.rb', line 32

def self.timeout=(value); @@timeout = value; end