Sha256: 78c467ef41402f023376e9962e2c25b39fa16daf4dfa99742bf90b28c8109e90

Contents?: true

Size: 849 Bytes

Versions: 5

Compression:

Stored size: 849 Bytes

Contents

# frozen_string_literal: true

module Strava
  module Web
    module Config
      extend self

      ATTRIBUTES = %i[
        proxy
        user_agent
        ca_path
        ca_file
        logger
        timeout
        open_timeout
      ].freeze

      attr_accessor(*Config::ATTRIBUTES)

      def reset
        self.user_agent = "Strava Ruby Client/#{Strava::VERSION}"
        self.ca_path = defined?(OpenSSL) ? OpenSSL::X509::DEFAULT_CERT_DIR : nil
        self.ca_file = defined?(OpenSSL) ? OpenSSL::X509::DEFAULT_CERT_FILE : nil
        self.proxy = nil
        self.logger = nil
        self.timeout = nil
        self.open_timeout = nil
      end
    end

    class << self
      def configure
        block_given? ? yield(Config) : Config
      end

      def config
        Config
      end
    end
  end
end

Strava::Web::Config.reset

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
strava-ruby-client-2.0.0 lib/strava/web/config.rb
strava-ruby-client-1.1.0 lib/strava/web/config.rb
strava-ruby-client-1.0.1 lib/strava/web/config.rb
strava-ruby-client-1.0.0 lib/strava/web/config.rb
strava-ruby-client-0.4.3 lib/strava/web/config.rb