Sha256: 63d37a52e89ca1315dbd4a3492c1f005592c386e5d12c9e006047e9a2e878e74

Contents?: true

Size: 806 Bytes

Versions: 3

Compression:

Stored size: 806 Bytes

Contents

module CoinMarketCap
  module Api
    module Config
      module Client
        ATTRIBUTES = %i[
          endpoint
          api_key
          user_agent
        ].freeze

        class << self
          include Config::Logger::Accessor

          attr_accessor(*ATTRIBUTES)

          def reset!
            self.endpoint = 'https://pro-api.coinmarketcap.com/v1'
            self.api_key = ENV['COINMARKETCAP_API_KEY']
            self.user_agent = "CoinMarketCap Ruby Client/#{CoinMarketCap::VERSION}"
          end
        end

        module Accessor
          def configure
            block_given? ? yield(Config::Client) : Config::Client
          end

          def config
            Config::Client
          end
        end
      end
    end
  end
end

CoinMarketCap::Api::Config::Client.reset!

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
coinmarketcap-ruby-client-1.1.1 lib/coinmarketcap/api/config/client.rb
coinmarketcap-ruby-client-1.1.0 lib/coinmarketcap/api/config/client.rb
coinmarketcap-ruby-client-1.0.0 lib/coinmarketcap/api/config/client.rb