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/speed.rb,
lib/barometer/data/units.rb,
lib/barometer/formats/icao.rb,
lib/barometer/data/distance.rb,
lib/barometer/data/location.rb,
lib/barometer/data/pressure.rb,
lib/barometer/formats/format.rb,
lib/barometer/formats/woe_id.rb,
lib/barometer/data/local_time.rb,
lib/barometer/formats/geocode.rb,
lib/barometer/formats/zipcode.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/measurements/result.rb,
lib/barometer/web_services/geocode.rb,
lib/barometer/formats/short_zipcode.rb,
lib/barometer/weather_services/noaa.rb,
lib/barometer/web_services/timezone.rb,
lib/barometer/weather_services/yahoo.rb,
lib/barometer/weather_services/google.rb,
lib/barometer/web_services/placemaker.rb,
lib/barometer/web_services/weather_id.rb,
lib/barometer/measurements/measurement.rb,
lib/barometer/weather_services/service.rb,
lib/barometer/web_services/web_service.rb,
lib/barometer/measurements/result_array.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, Measurement, OutOfSources, Query, Weather, WeatherService, WebService

Constant Summary collapse

@@debug_mode =
false
@@yahoo_placemaker_app_id =
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
@@enhance_timezone =
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



51
52
53
# File 'lib/barometer.rb', line 51

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

.debugObject



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

def self.debug; @@debug_mode; end

.debug!Object



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

def self.debug!; @@debug_mode = true; end

.debug=(value) ⇒ Object



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

def self.debug=(value); @@debug_mode = value; end

.debug?Boolean

Returns:

  • (Boolean)


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

def self.debug?; @@debug_mode; end

.enhance_timezoneObject



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

def self.enhance_timezone; @@enhance_timezone; end

.enhance_timezone!Object



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

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

.enhance_timezone=(value) ⇒ Object



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

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

.force_geocodeObject



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

def self.force_geocode; @@force_geocode; end

.force_geocode!Object



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

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

.force_geocode=(value) ⇒ Object



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

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

.new(query = nil) ⇒ Object



45
46
47
# File 'lib/barometer.rb', line 45

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

.source(source) ⇒ Object

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



58
59
60
# File 'lib/barometer.rb', line 58

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

.timeoutObject



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

def self.timeout; @@timeout; end

.timeout=(value) ⇒ Object



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

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

.yahoo_placemaker_app_idObject



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

def self.yahoo_placemaker_app_id; @@yahoo_placemaker_app_id; end

.yahoo_placemaker_app_id=(yahoo_key) ⇒ Object



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

def self.yahoo_placemaker_app_id=(yahoo_key); @@yahoo_placemaker_app_id = yahoo_key; end