Class: Barometer::Query::Format::Base
- Inherits:
-
Object
- Object
- Barometer::Query::Format::Base
show all
- Defined in:
- lib/barometer/query/formats/base.rb
Overview
Base Format Class
Fromats are used to determine if a query is of a certain format, how to convert to and from that format and what the country_code is for that format (if possible).
Direct Known Subclasses
Coordinates, Geocode, Icao, Ipv4Address, NoaaStationId, Postalcode, ShortZipcode, Unknown, WeatherID, WoeID, Zipcode
Class Method Summary
collapse
Class Method Details
.convert_query(query) ⇒ Object
14
|
# File 'lib/barometer/query/formats/base.rb', line 14
def self.convert_query(query); query; end
|
.geo(query) ⇒ Object
13
|
# File 'lib/barometer/query/formats/base.rb', line 13
def self.geo(query); nil; end
|
.is?(query) ⇒ Boolean
16
17
18
|
# File 'lib/barometer/query/formats/base.rb', line 16
def self.is?(query)
!(query =~ self.regex).nil?
end
|
.regex ⇒ Object
12
|
# File 'lib/barometer/query/formats/base.rb', line 12
def self.regex; raise NotImplementedError; end
|