class Plaid::Client::ThinClient

Attributes

access_token[RW]
client_id[RW]
email[RW]
endpoint[RW]
institution[RW]
secret[RW]

Public Class Methods

new(e_mail, institution, access_token) click to toggle source
# 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

Public Instance Methods

handle(response) { |response| ... } click to toggle source

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

# 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) click to toggle source

for testing through IRB

# 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() click to toggle source
# 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