Class: Fireblocks::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/fireblocks/configuration.rb

Overview

base_url is set to a default but can be configured

Constant Summary collapse

Error =
Class.new(StandardError)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



13
14
15
16
17
# File 'lib/fireblocks/configuration.rb', line 13

def initialize
  @api_key = nil
  @private_key = nil
  @base_url = 'https://api.fireblocks.io'
end

Instance Attribute Details

#api_keyObject

Raises:



19
20
21
22
23
24
25
26
# File 'lib/fireblocks/configuration.rb', line 19

def api_key
  message =
    'Fireblocks api key not set. See Fireblocks documentation ' \
    'to get a hold of your api key'
  raise Error, message unless @api_key

  @api_key
end

#base_urlObject

Returns the value of attribute base_url.



11
12
13
# File 'lib/fireblocks/configuration.rb', line 11

def base_url
  @base_url
end

#private_keyObject

Raises:



28
29
30
31
32
33
34
35
# File 'lib/fireblocks/configuration.rb', line 28

def private_key
  message =
    'Fireblocks private key not set. See Fireblocks documentation ' \
    'to get a hold of your private key'
  raise Error, message unless @private_key

  @private_key
end