Sha256: 36dab35bffad31617b6c947e8916e755b79abb7e5602ac1557f423e12ba3e4fe

Contents?: true

Size: 636 Bytes

Versions: 8

Compression:

Stored size: 636 Bytes

Contents

require_relative 'query/base'
require_relative 'query/format'
require_relative 'query/converter'
require_relative 'query/service'

module Barometer
  class ConvertedQuery
    attr_reader :q, :format, :units, :geo

    def initialize(q, format, units=:metric, geo=nil)
      @q = q
      @format = format
      @units = units
      @geo = geo
    end

    def metric?
      units == :metric
    end

    def to_s
      @q
    end
  end

  module Query
    class ConversionNotPossible < StandardError; end
    class UnsupportedRegion < StandardError; end

    def self.new(*args)
      Barometer::Query::Base.new(*args)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
barometer-0.9.7 lib/barometer/query.rb
barometer-0.9.6 lib/barometer/query.rb
barometer-0.9.5 lib/barometer/query.rb
barometer-0.9.4 lib/barometer/query.rb
barometer-0.9.3 lib/barometer/query.rb
barometer-0.9.2 lib/barometer/query.rb
barometer-0.9.1 lib/barometer/query.rb
barometer-0.9.0 lib/barometer/query.rb