Class: Plaid::Client
- Inherits:
-
Object
- Object
- Plaid::Client
- Defined in:
- lib/plaid/client.rb
Overview
Public: A class encapsulating client_id, secret, and Plaid API URL.
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Public: The String Plaid account client ID to authenticate requests.
-
#env ⇒ Object
Public: Plaid environment, i.e.
-
#secret ⇒ Object
Public: The String Plaid account secret to authenticate requests.
Instance Method Summary collapse
-
#client_id_configured? ⇒ Boolean
Public: Check if client_id is configured.
-
#initialize(env: nil, client_id: nil, secret: nil) ⇒ Client
constructor
Public: Construct a Client instance.
-
#secret_configured? ⇒ Boolean
Public: Check if client_id is configured.
Constructor Details
#initialize(env: nil, client_id: nil, secret: nil) ⇒ Client
Public: Construct a Client instance.
env - The Symbol (:tartan, :production), or a full String URL like
'https://tartan.plaid.com'.
client_id - The String Plaid account client ID to authenticate requests. secret - The String Plaid account secret to authenticate requests.
49 50 51 52 53 |
# File 'lib/plaid/client.rb', line 49 def initialize(env: nil, client_id: nil, secret: nil) env && self.env = env self.client_id = client_id self.secret = secret end |
Instance Attribute Details
#client_id ⇒ Object
Public: The String Plaid account client ID to authenticate requests.
5 6 7 |
# File 'lib/plaid/client.rb', line 5 def client_id @client_id end |
#env ⇒ Object
Public: Plaid environment, i.e. String base URL of the API site.
E.g. ‘tartan.plaid.com’.
13 14 15 |
# File 'lib/plaid/client.rb', line 13 def env @env end |
#secret ⇒ Object
Public: The String Plaid account secret to authenticate requests.
8 9 10 |
# File 'lib/plaid/client.rb', line 8 def secret @secret end |
Instance Method Details
#client_id_configured? ⇒ Boolean
Public: Check if client_id is configured.
Returns true if it is.
58 59 60 |
# File 'lib/plaid/client.rb', line 58 def client_id_configured? @client_id.is_a?(String) && !@client_id.empty? end |
#secret_configured? ⇒ Boolean
Public: Check if client_id is configured.
Returns true if it is.
65 66 67 |
# File 'lib/plaid/client.rb', line 65 def secret_configured? @secret.is_a?(String) && !@secret.empty? end |