Sha256: a1b915766836e8f5a51f168dedb2104443665bafdf8513dffe37b3a41e818b5c
Contents?: true
Size: 895 Bytes
Versions: 2
Compression:
Stored size: 895 Bytes
Contents
require 'active_support/inflector' require 'base64' require 'securerandom' require 'addressable/uri' require 'httparty' require 'hashie' require 'pry' module KrakenClient class Application def initialize(params) set_config(params) end def public(options = {}) ::KrakenClient::Endpoints::Public.new(config, options) end def private(options = {}) requires_api_keys ::KrakenClient::Endpoints::Private.new(config, options) end def config @config ||= ::KrakenClient.config.dup end private def requires_api_keys return unless api_keys_missing? fail KrakenClient::MissingApiKeys, 'This feature requires API credentials.' end def api_keys_missing? !(config.api_key && config.api_secret) end def set_config(params) params.each { |k, v| config.send("#{k}=", v) } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
kraken_client-1.1.0 | lib/kraken_client/application.rb |
kraken_client-1.0.3 | lib/kraken_client/application.rb |