Sha256: 90b469aff3a762ea1e5e4c6c4cc76d599dd4f48ac13cc3062b59ca0f11db9669

Contents?: true

Size: 818 Bytes

Versions: 8

Compression:

Stored size: 818 Bytes

Contents

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

8 entries across 8 versions & 1 rubygems

Version Path
strava-ruby-client-0.4.2 lib/strava/web/config.rb
strava-ruby-client-0.4.1 lib/strava/web/config.rb
strava-ruby-client-0.4.0 lib/strava/web/config.rb
strava-ruby-client-0.3.2 lib/strava/web/config.rb
strava-ruby-client-0.3.1 lib/strava/web/config.rb
strava-ruby-client-0.3.0 lib/strava/web/config.rb
strava-ruby-client-0.2.0 lib/strava/web/config.rb
strava-ruby-client-0.1.0 lib/strava/web/config.rb