Sha256: 43322a40f453fc176e5eb7961fe79392f8c492b54166b67d4426ddaf12a480cc

Contents?: true

Size: 799 Bytes

Versions: 237

Compression:

Stored size: 799 Bytes

Contents

module Sportradar
  module Api
    class << self
      attr_accessor :config
    end

    def self.config
      @config ||= Config.new
    end

    # Set options via block
    def self.configure
      yield(config) if block_given?
    end

    class Config
      attr_accessor :api_timeout, :use_ssl, :format

      def initialize
        @api_key = ENV['API_KEY']
        @api_timeout = ENV.fetch('SPORTRADAR_API_TIMEOUT', 15 )
        @use_ssl = ENV.fetch('SPORTRADAR_API_USE_SSL', true)
        @format = ENV.fetch("SPORTRADAR_API_FORMAT", :xml).to_s
      end

      def reset
        @api_timeout = ENV.fetch('SPORTRADAR_API_TIMEOUT', 15 )
        @use_ssl = ENV.fetch('SPORTRADAR_API_USE_SSL', true)
        @format = ENV.fetch("SPORTRADAR_API_FORMAT", :xml).to_s
      end
    end
  end
end

Version data entries

237 entries across 237 versions & 1 rubygems

Version Path
sportradar-api-0.20.2 lib/sportradar/api/config.rb
sportradar-api-0.20.1 lib/sportradar/api/config.rb
sportradar-api-0.20.0 lib/sportradar/api/config.rb
sportradar-api-0.20.0.pre2 lib/sportradar/api/config.rb
sportradar-api-0.20.0.pre lib/sportradar/api/config.rb
sportradar-api-0.19.6 lib/sportradar/api/config.rb
sportradar-api-0.19.5 lib/sportradar/api/config.rb
sportradar-api-0.19.4 lib/sportradar/api/config.rb
sportradar-api-0.19.3 lib/sportradar/api/config.rb
sportradar-api-0.19.2 lib/sportradar/api/config.rb
sportradar-api-0.19.1 lib/sportradar/api/config.rb
sportradar-api-0.19.0 lib/sportradar/api/config.rb
sportradar-api-0.18.1 lib/sportradar/api/config.rb
sportradar-api-0.18.0 lib/sportradar/api/config.rb
sportradar-api-0.17.6 lib/sportradar/api/config.rb
sportradar-api-0.17.5 lib/sportradar/api/config.rb
sportradar-api-0.17.5.pre lib/sportradar/api/config.rb
sportradar-api-0.17.4 lib/sportradar/api/config.rb
sportradar-api-0.17.3 lib/sportradar/api/config.rb
sportradar-api-0.17.2 lib/sportradar/api/config.rb