Sha256: 5ab919f78d14a7c957ad9a479380d11625490899abdf1e9fb8e6a768a5eddcdf

Contents?: true

Size: 693 Bytes

Versions: 8

Compression:

Stored size: 693 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)
      if log.respond_to?(:<<)
        RestClient.log = log
      else
        raise "#{log.class} doesn't seem to behave like a logger!"
      end
    end

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

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
onfido-0.8.2 lib/onfido/configuration.rb
onfido-0.8.1 lib/onfido/configuration.rb
onfido-0.7.1 lib/onfido/configuration.rb
onfido-0.7.0 lib/onfido/configuration.rb
onfido-0.6.1 lib/onfido/configuration.rb
onfido-0.6.0 lib/onfido/configuration.rb
onfido-0.5.0 lib/onfido/configuration.rb
onfido-0.4.0 lib/onfido/configuration.rb