Sha256: f532bcfd29dcc387e4f6be58e8a66377677f8900593d6b240ac660753891b97c

Contents?: true

Size: 564 Bytes

Versions: 2

Compression:

Stored size: 564 Bytes

Contents

module Barometer
  module Query
    module Format
      #
      # 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 Base
        def self.regex; raise NotImplementedError; end
        def self.country_code(query); nil; end
        def self.convert_query(query); query; end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
barometer-0.9.1 lib/barometer/query/formats/base.rb
barometer-0.9.0 lib/barometer/query/formats/base.rb