Module: Barometer
- Defined in:
- lib/barometer.rb,
lib/barometer/base.rb,
lib/barometer/query.rb,
lib/barometer/version.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/key_file_parser.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/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/web_services/noaa_station_id.rb,
lib/barometer/weather_services/wunderground.rb
Defined Under Namespace
Classes: Base, KeyFileParser, Measurement, OutOfSources, Query, Weather, WeatherService, WebService
Constant Summary
collapse
- VERSION =
'0.8.0'
- KEY_FILE =
File.expand_path(File.join('~', '.barometer'))
- @@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
60
61
62
|
# File 'lib/barometer.rb', line 60
def self.config=(config=nil)
Barometer::Base.config = config
end
|
.debug ⇒ Object
15
|
# File 'lib/barometer.rb', line 15
def self.debug; @@debug_mode; end
|
.debug! ⇒ Object
17
|
# File 'lib/barometer.rb', line 17
def self.debug!; @@debug_mode = true; end
|
.debug=(value) ⇒ Object
16
|
# File 'lib/barometer.rb', line 16
def self.debug=(value); @@debug_mode = value; end
|
.debug? ⇒ Boolean
18
|
# File 'lib/barometer.rb', line 18
def self.debug?; @@debug_mode; end
|
.enhance_timezone ⇒ Object
44
|
# File 'lib/barometer.rb', line 44
def self.enhance_timezone; @@enhance_timezone; end
|
.enhance_timezone! ⇒ Object
46
|
# File 'lib/barometer.rb', line 46
def self.enhance_timezone!; @@enhance_timezone = true; end
|
.enhance_timezone=(value) ⇒ Object
45
|
# File 'lib/barometer.rb', line 45
def self.enhance_timezone=(value); @@enhance_timezone = value; end
|
.force_geocode ⇒ Object
39
|
# File 'lib/barometer.rb', line 39
def self.force_geocode; @@force_geocode; end
|
.force_geocode! ⇒ Object
41
|
# File 'lib/barometer.rb', line 41
def self.force_geocode!; @@force_geocode = true; end
|
.force_geocode=(value) ⇒ Object
40
|
# File 'lib/barometer.rb', line 40
def self.force_geocode=(value); @@force_geocode = value; end
|
.google_geocode_key ⇒ Object
20
21
22
|
# File 'lib/barometer.rb', line 20
def self.google_geocode_key
warn "[DEPRECATION] `Barometer.google_geocode_key` is deprecated. A Google API key is no longer needed"
end
|
.google_geocode_key=(google_key) ⇒ Object
23
24
25
|
# File 'lib/barometer.rb', line 23
def self.google_geocode_key=(google_key)
warn "[DEPRECATION] `Barometer.google_geocode_key=(key)` is deprecated. A Google API key is no longer needed"
end
|
.new(query = nil) ⇒ Object
54
55
56
|
# File 'lib/barometer.rb', line 54
def self.new(query=nil)
Barometer::Base.new(query)
end
|
.source(source) ⇒ Object
shortcut to Barometer::Service.source method
allows Barometer.source(:wunderground)
67
68
69
|
# File 'lib/barometer.rb', line 67
def self.source(source)
Barometer::WeatherService.source(source)
end
|
.timeout ⇒ Object
51
|
# File 'lib/barometer.rb', line 51
def self.timeout; @@timeout; end
|
.timeout=(value) ⇒ Object
52
|
# File 'lib/barometer.rb', line 52
def self.timeout=(value); @@timeout = value; end
|
.yahoo_placemaker_app_id ⇒ Object
28
|
# File 'lib/barometer.rb', line 28
def self.yahoo_placemaker_app_id; @@yahoo_placemaker_app_id; end
|
.yahoo_placemaker_app_id=(yahoo_key) ⇒ Object
29
|
# File 'lib/barometer.rb', line 29
def self.yahoo_placemaker_app_id=(yahoo_key); @@yahoo_placemaker_app_id = yahoo_key; end
|