Class: EngivenAPI::Client

Inherits:
Object
  • Object
show all
Includes:
Customer, Fund, Gift, Misc
Defined in:
lib/engiven/client.rb,
lib/engiven/resources/fund.rb,
lib/engiven/resources/gift.rb,
lib/engiven/resources/misc.rb,
lib/engiven/resources/customer.rb

Defined Under Namespace

Modules: Customer, Fund, Gift, Misc

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Misc

#get_pricefeed, #get_supported_crypto

Methods included from Gift

#create_pledged_gift, #list_gifts

Methods included from Fund

#create_fund, #find_fund, #list_funds, #update_fund

Methods included from Customer

#create_customer, #find_customer, #list_customers, #remove_logo, #update_customer, #upload_logo

Constructor Details

#initialize(api_key:, test_mode: false, logger: true, adapter: Faraday.default_adapter, ssl: nil) ⇒ Client

Returns a new instance of Client.



19
20
21
22
23
24
# File 'lib/engiven/client.rb', line 19

def initialize(api_key:, test_mode: false, logger: true, adapter: Faraday.default_adapter, ssl: nil)
  @api_key = api_key
  @test_mode = test_mode
  @logger = logger
  @adapter = adapter
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



17
18
19
# File 'lib/engiven/client.rb', line 17

def adapter
  @adapter
end

#api_keyObject (readonly)

Returns the value of attribute api_key.



17
18
19
# File 'lib/engiven/client.rb', line 17

def api_key
  @api_key
end

#loggerObject (readonly)

Returns the value of attribute logger.



17
18
19
# File 'lib/engiven/client.rb', line 17

def logger
  @logger
end

#sslObject (readonly)

Returns the value of attribute ssl.



17
18
19
# File 'lib/engiven/client.rb', line 17

def ssl
  @ssl
end

#test_modeObject (readonly)

Returns the value of attribute test_mode.



17
18
19
# File 'lib/engiven/client.rb', line 17

def test_mode
  @test_mode
end

Instance Method Details

#delete(path, options = {}) ⇒ Object



26
27
28
# File 'lib/engiven/client.rb', line 26

def delete(path, options = {})
  connection.delete(path, options).body
end

#get(path, options = {}) ⇒ Object



30
31
32
# File 'lib/engiven/client.rb', line 30

def get(path, options = {})
  connection.get(path, options).body
end

#post(path, options = {}) ⇒ Object



34
35
36
# File 'lib/engiven/client.rb', line 34

def post(path, options = {})
  connection.post(path, options).body
end