Class: EngivenAPI::Client
- Inherits:
-
Object
- Object
- EngivenAPI::Client
- 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
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#ssl ⇒ Object
readonly
Returns the value of attribute ssl.
-
#test_mode ⇒ Object
readonly
Returns the value of attribute test_mode.
Instance Method Summary collapse
- #delete(path, options = {}) ⇒ Object
- #get(path, options = {}) ⇒ Object
-
#initialize(api_key:, test_mode: false, logger: true, adapter: Faraday.default_adapter, ssl: nil) ⇒ Client
constructor
A new instance of Client.
- #post(path, options = {}) ⇒ Object
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
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
17 18 19 |
# File 'lib/engiven/client.rb', line 17 def adapter @adapter end |
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
17 18 19 |
# File 'lib/engiven/client.rb', line 17 def api_key @api_key end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
17 18 19 |
# File 'lib/engiven/client.rb', line 17 def logger @logger end |
#ssl ⇒ Object (readonly)
Returns the value of attribute ssl.
17 18 19 |
# File 'lib/engiven/client.rb', line 17 def ssl @ssl end |
#test_mode ⇒ Object (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, = {}) connection.delete(path, ).body end |
#get(path, options = {}) ⇒ Object
30 31 32 |
# File 'lib/engiven/client.rb', line 30 def get(path, = {}) connection.get(path, ).body end |
#post(path, options = {}) ⇒ Object
34 35 36 |
# File 'lib/engiven/client.rb', line 34 def post(path, = {}) connection.post(path, ).body end |