Sha256: dc83805977611160231965b58b1238c78d43131d9ca2ae0ecf94b59c417a9034

Contents?: true

Size: 685 Bytes

Versions: 4

Compression:

Stored size: 685 Bytes

Contents

module Onfido
  module Configuration
    attr_accessor :api_key, :open_timeout, :read_timeout, :api_version

    def self.extended(base)
      base.reset
    end

    def configure
      yield self
    end

    def reset
      self.api_key = nil
      self.open_timeout = 30
      self.read_timeout = 80
      self.api_version = 'v2'
      RestClient.log = nil
    end

    def logger=(log)
      unless log.respond_to?(:<<)
        raise "#{log.class} doesn't seem to behave like a logger!"
      end

      RestClient.log = log
    end

    def logger
      RestClient.log ||= NullLogger.new
    end

    def endpoint
      "https://api.onfido.com/#{api_version}/"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
onfido-0.10.0 lib/onfido/configuration.rb
onfido-0.9.0 lib/onfido/configuration.rb
onfido-0.8.4 lib/onfido/configuration.rb
onfido-0.8.3 lib/onfido/configuration.rb