Module: Cryptoprocessing::Default

Defined in:
lib/cryptoprocessing/default.rb

Constant Summary collapse

API_ENDPOINT =

Default API endpoint

'https://api.cryptoprocessing.io'.freeze
API_NAMESPACE =

Default API namespace (suffix)

'/api'.freeze
BLOCKCHAIN_TYPE =
'btc'.freeze
USER_AGENT =

Default User Agent header string

"cryproprocessing/ruby/#{Cryptoprocessing::VERSION}".freeze

Class Method Summary collapse

Class Method Details

.access_tokenString

Default access token from ENV

Returns:

  • (String)


26
27
28
# File 'lib/cryptoprocessing/default.rb', line 26

def access_token
  ENV['CRYPTOPROCESSING_ACCESS_TOKEN']
end

.api_endpointString

Default API endpoint from ENV or API_ENDPOINT

Returns:

  • (String)


32
33
34
# File 'lib/cryptoprocessing/default.rb', line 32

def api_endpoint
  ENV['CRYPTOPROCESSING_API_ENDPOINT'] || API_ENDPOINT
end

.api_namespaceString

Default API namespace from ENV or API_NAMESPACE

Returns:

  • (String)


38
39
40
# File 'lib/cryptoprocessing/default.rb', line 38

def api_namespace
  ENV['CRYPTOPROCESSING_API_NAMESPACE'] || API_NAMESPACE
end

.blockchain_typeObject



42
43
44
# File 'lib/cryptoprocessing/default.rb', line 42

def blockchain_type
  ENV['CRYPTOPROCESSING_BLOCKCHAIN_TYPE'] || BLOCKCHAIN_TYPE
end

.emailString

Default Cryptoprocessing email for Auth from ENV

Returns:

  • (String)


48
49
50
# File 'lib/cryptoprocessing/default.rb', line 48

def email
  ENV['CRYPTOPROCESSING_EMAIL']
end

.netrcBoolean

Default behavior for reading .netrc file

Returns:

  • (Boolean)


66
67
68
# File 'lib/cryptoprocessing/default.rb', line 66

def netrc
  ENV['CRYPTOPROCESSING_NETRC'] || false
end

.netrc_fileString

Default path for .netrc file

Returns:

  • (String)


72
73
74
# File 'lib/cryptoprocessing/default.rb', line 72

def netrc_file
  ENV['CRYPTOPROCESSING_NETRC_FILE'] || File.join(ENV['HOME'].to_s, '.netrc')
end

.optionsHash

Configuration options

Returns:

  • (Hash)


20
21
22
# File 'lib/cryptoprocessing/default.rb', line 20

def options
  Hash[Cryptoprocessing::Configurable.keys.map{|key| [key, send(key)]}]
end

.passwordString

Default Cryptoprocessing password for Auth from ENV

Returns:

  • (String)


54
55
56
# File 'lib/cryptoprocessing/default.rb', line 54

def password
  ENV['CRYPTOPROCESSING_PASSWORD']
end

.user_agentString

Default User-Agent header string from ENV or USER_AGENT

Returns:

  • (String)


60
61
62
# File 'lib/cryptoprocessing/default.rb', line 60

def user_agent
  ENV['CRYPTOPROCESSING_USER_AGENT'] || USER_AGENT
end