Class: Barometer::Query::Format::Base

Inherits:
Object
  • Object
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).

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

Returns:

  • (Boolean)


16
17
18
# File 'lib/barometer/query/formats/base.rb', line 16

def self.is?(query)
  !(query =~ self.regex).nil?
end

.regexObject

Raises:

  • (NotImplementedError)


12
# File 'lib/barometer/query/formats/base.rb', line 12

def self.regex; raise NotImplementedError; end