Class: Barometer::Query::Format::ShortZipcode
- Inherits:
-
Barometer::Query::Format
- Object
- Barometer::Query::Format
- Barometer::Query::Format::ShortZipcode
- Defined in:
- lib/barometer/formats/short_zipcode.rb
Overview
Format: Zip Code (short)
eg. 90210
This class is used to determine if a query is a :short_zipcode and what the country_code is.
Class Method Summary collapse
Methods inherited from Barometer::Query::Format
convertable_formats, converts?, is?, is_a_query?, to
Class Method Details
.country_code(query = nil) ⇒ Object
13 |
# File 'lib/barometer/formats/short_zipcode.rb', line 13 def self.country_code(query=nil); "US"; end |
.format ⇒ Object
12 |
# File 'lib/barometer/formats/short_zipcode.rb', line 12 def self.format; :short_zipcode; end |
.regex ⇒ Object
14 |
# File 'lib/barometer/formats/short_zipcode.rb', line 14 def self.regex; /(^[0-9]{5}$)/; end |