Class: CoinMarketCap::Api::Client

Inherits:
Object
  • Object
show all
Includes:
Cloud::Connection, Cloud::Request, Endpoints::Cryptocurrency
Defined in:
lib/coinmarketcap/api/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Cloud::Request

#delete, #get, #post, #put

Methods included from Endpoints::Cryptocurrency

#info, #listings_latest, #map, #quotes_latest

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



16
17
18
19
20
21
22
# File 'lib/coinmarketcap/api/client.rb', line 16

def initialize(options = {})
  Config::Client::ATTRIBUTES.each do |key|
    send("#{key}=", options[key] || CoinMarketCap::Api.config.send(key))
  end
  @logger = Config::Logger.dup
  @logger.instance = options[:logger] if options.key?(:logger)
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



14
15
16
# File 'lib/coinmarketcap/api/client.rb', line 14

def logger
  @logger
end