Class: FTX::API::Base

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/ftx/api/base.rb

Direct Known Subclasses

Private, Public

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Base

Returns a new instance of Base.



12
13
14
15
16
# File 'lib/ftx/api/base.rb', line 12

def initialize(args = {})
  @config = FTX::API::Config.new(args.dig(:config))
  @key = args.fetch(:key, ENV['FTX_KEY'])
  @secret = args.fetch(:secret, ENV['FTX_SECRET'])
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



7
8
9
# File 'lib/ftx/api/base.rb', line 7

def config
  @config
end

#keyObject (readonly)

Returns the value of attribute key.



7
8
9
# File 'lib/ftx/api/base.rb', line 7

def key
  @key
end

#secretObject (readonly)

Returns the value of attribute secret.



7
8
9
# File 'lib/ftx/api/base.rb', line 7

def secret
  @secret
end