Class: Hyperwallet::Client
- Inherits:
-
Object
- Object
- Hyperwallet::Client
- Includes:
- BankAccount, Payment, User, WebhookNotification
- Defined in:
- lib/hyperwallet/client.rb,
lib/hyperwallet/resources/user.rb,
lib/hyperwallet/resources/payment.rb,
lib/hyperwallet/resources/bank_account.rb,
lib/hyperwallet/resources/webhook_notification.rb
Defined Under Namespace
Modules: BankAccount, Payment, User, WebhookNotification
Constant Summary
Constants included from WebhookNotification
Constants included from User
Constants included from Payment
Constants included from BankAccount
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#proxy ⇒ Object
readonly
Returns the value of attribute proxy.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #delete(path, options = {}) ⇒ Object
- #get(path, options = {}) ⇒ Object
-
#initialize(url:, username:, password:, logger: true, adapter: Faraday.default_adapter, proxy: nil) ⇒ Client
constructor
A new instance of Client.
- #patch(path, options = {}) ⇒ Object
- #post(path, options = {}) ⇒ Object
- #put(path, options = {}) ⇒ Object
Methods included from WebhookNotification
Methods included from User
#create_user, #find_user, #list_users
Methods included from Payment
#create_payment, #find_payment, #list_payments
Methods included from BankAccount
#create_bank_account, #find_bank_account, #list_bank_accounts
Constructor Details
#initialize(url:, username:, password:, logger: true, adapter: Faraday.default_adapter, proxy: nil) ⇒ Client
Returns a new instance of Client.
16 17 18 19 20 21 22 23 |
# File 'lib/hyperwallet/client.rb', line 16 def initialize(url:, username:, password:, logger: true, adapter: Faraday.default_adapter, proxy: nil) @url = "#{url}/rest/v4/" @username = username @password = password @logger = logger @adapter = adapter @proxy = proxy end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
14 15 16 |
# File 'lib/hyperwallet/client.rb', line 14 def adapter @adapter end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
14 15 16 |
# File 'lib/hyperwallet/client.rb', line 14 def logger @logger end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
14 15 16 |
# File 'lib/hyperwallet/client.rb', line 14 def password @password end |
#proxy ⇒ Object (readonly)
Returns the value of attribute proxy.
14 15 16 |
# File 'lib/hyperwallet/client.rb', line 14 def proxy @proxy end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
14 15 16 |
# File 'lib/hyperwallet/client.rb', line 14 def url @url end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
14 15 16 |
# File 'lib/hyperwallet/client.rb', line 14 def username @username end |
Instance Method Details
#delete(path, options = {}) ⇒ Object
25 26 27 |
# File 'lib/hyperwallet/client.rb', line 25 def delete(path, = {}) connection.delete(path, ).body end |
#get(path, options = {}) ⇒ Object
29 30 31 |
# File 'lib/hyperwallet/client.rb', line 29 def get(path, = {}) connection.get(path, ).body end |
#patch(path, options = {}) ⇒ Object
33 34 35 |
# File 'lib/hyperwallet/client.rb', line 33 def patch(path, = {}) connection.patch(path, ).body end |
#post(path, options = {}) ⇒ Object
37 38 39 |
# File 'lib/hyperwallet/client.rb', line 37 def post(path, = {}) connection.post(path, ).body end |
#put(path, options = {}) ⇒ Object
41 42 43 |
# File 'lib/hyperwallet/client.rb', line 41 def put(path, = {}) connection.put(path, ).body end |