Sha256: 438e121c5a8daff4ab7f7561c2b79a7d5ccab4f68d2bbead923c32a91e838f98

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

module IEX
  module Api
    module Config
      module Client
        ATTRIBUTES = %i[
          ca_file
          ca_path
          endpoint
          open_timeout
          proxy
          publishable_token
          referer
          secret_token
          timeout
          user_agent
        ].freeze

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

          attr_accessor(*ATTRIBUTES)

          def reset!
            self.endpoint = 'https://cloud.iexapis.com/v1'
            self.publishable_token = ENV['IEX_API_PUBLISHABLE_TOKEN']
            self.secret_token = ENV['IEX_API_SECRET_TOKEN']
            self.user_agent = "IEX Ruby Client/#{IEX::VERSION}"

            self.ca_file = nil
            self.ca_path = nil
            self.open_timeout = nil
            self.proxy = nil
            self.referer = nil
            self.timeout = nil
          end
        end

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

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

IEX::Api::Config::Client.reset!

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
iex-ruby-client-2.1.0 lib/iex/api/config/client.rb
iex-ruby-client-2.0.0 lib/iex/api/config/client.rb