Sha256: aafd6118fb303247fc7caaa7d1f5877d4a67f437e5382140aba995c4e086b764

Contents?: true

Size: 598 Bytes

Versions: 8

Compression:

Stored size: 598 Bytes

Contents

require 'timezone/error'

module Timezone
  module Lookup
    class Basic
      attr_reader :config

      def initialize(config)
        if config.protocol.nil?
          raise(::Timezone::Error::InvalidConfig, 'missing protocol')
        end

        if config.url.nil?
          raise(::Timezone::Error::InvalidConfig, 'missing url')
        end

        @config = config
      end

      def client
        @client ||= config.http_client.new(config.protocol, config.url)
      end

      def lookup(lat, lng)
        raise NoMethodError, 'lookup is not implemented'
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
timezone-0.6.0 lib/timezone/lookup/basic.rb
timezone-0.5.0 lib/timezone/lookup/basic.rb
timezone-0.4.3 lib/timezone/lookup/basic.rb
timezone-0.4.2 lib/timezone/lookup/basic.rb
timezone-0.4.1 lib/timezone/lookup/basic.rb
timezone-0.4.0 lib/timezone/lookup/basic.rb
timezone-0.3.11 lib/timezone/lookup/basic.rb
timezone-0.3.10 lib/timezone/lookup/basic.rb