Class: Plaid::Client::ThinClient
- Inherits:
-
Object
- Object
- Plaid::Client::ThinClient
- Includes:
- HTTParty, Balances, Bodies, Configurations, Entities, Followups
- Defined in:
- lib/plaid/client/thin_client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#email ⇒ Object
Returns the value of attribute email.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#institution ⇒ Object
Returns the value of attribute institution.
-
#secret ⇒ Object
Returns the value of attribute secret.
Instance Method Summary collapse
-
#handle(response) ⇒ Object
generic method for handling the structure of the response.
-
#initialize(e_mail, institution, access_token) ⇒ ThinClient
constructor
A new instance of ThinClient.
-
#secrets(client_id, secret) ⇒ Object
for testing through IRB.
- #settings ⇒ Object
Methods included from Followups
Methods included from Balances
Methods included from Entities
Methods included from Bodies
#body, #body_delete_user, #body_entity, #body_init_user, #body_mfa, #body_mfa_mode, #body_mfa_webhook, #body_original, #body_retrieve, #body_test, #body_update_credentials, #credentials, #options
Constructor Details
#initialize(e_mail, institution, access_token) ⇒ ThinClient
Returns a new instance of ThinClient.
29 30 31 32 33 |
# File 'lib/plaid/client/thin_client.rb', line 29 def initialize(e_mail, institution, access_token) self.email = e_mail self.institution = institution self.access_token = access_token end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
5 6 7 |
# File 'lib/plaid/client/thin_client.rb', line 5 def access_token @access_token end |
#client_id ⇒ Object
Returns the value of attribute client_id.
5 6 7 |
# File 'lib/plaid/client/thin_client.rb', line 5 def client_id @client_id end |
#email ⇒ Object
Returns the value of attribute email.
5 6 7 |
# File 'lib/plaid/client/thin_client.rb', line 5 def email @email end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
5 6 7 |
# File 'lib/plaid/client/thin_client.rb', line 5 def endpoint @endpoint end |
#institution ⇒ Object
Returns the value of attribute institution.
5 6 7 |
# File 'lib/plaid/client/thin_client.rb', line 5 def institution @institution end |
#secret ⇒ Object
Returns the value of attribute secret.
5 6 7 |
# File 'lib/plaid/client/thin_client.rb', line 5 def secret @secret end |
Instance Method Details
#handle(response) ⇒ Object
generic method for handling the structure of the response. Only creates an error object if there is an error (business error) from Plaid.com. Yields to the block with calling function
52 53 54 55 56 57 58 |
# File 'lib/plaid/client/thin_client.rb', line 52 def handle(response) if response.code.eql? 200 yield(response) if block_given? else PlaidError.new(response, "Error") end end |
#secrets(client_id, secret) ⇒ Object
for testing through IRB
36 37 38 39 40 |
# File 'lib/plaid/client/thin_client.rb', line 36 def secrets(client_id, secret) self.client_id = client_id self.secret = secret "Set" end |
#settings ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/plaid/client/thin_client.rb', line 42 def settings puts "Base URI: " + endpoint.to_s puts "Cert: " + certpath.to_s puts "Email: " + self.email.to_s puts "Plaid Client_id: " + self.client_id.to_s puts "Webhook address: " + webhook_address puts "Save full response: " + save_full_response.to_s end |