Class: Plaid::PlaidSecretCredentials
- Inherits:
-
Object
- Object
- Plaid::PlaidSecretCredentials
- Defined in:
- lib/plaid/http/auth/plaid_secret.rb
Overview
Data class for PlaidSecretCredentials. Data class for PlaidSecretCredentials.
Instance Attribute Summary collapse
-
#plaid_secret ⇒ Object
readonly
Returns the value of attribute plaid_secret.
Class Method Summary collapse
Instance Method Summary collapse
- #clone_with(plaid_secret: nil) ⇒ Object
-
#initialize(plaid_secret:) ⇒ PlaidSecretCredentials
constructor
A new instance of PlaidSecretCredentials.
Constructor Details
#initialize(plaid_secret:) ⇒ PlaidSecretCredentials
Returns a new instance of PlaidSecretCredentials.
30 31 32 33 34 |
# File 'lib/plaid/http/auth/plaid_secret.rb', line 30 def initialize(plaid_secret:) raise ArgumentError, 'plaid_secret cannot be nil' if plaid_secret.nil? @plaid_secret = plaid_secret end |
Instance Attribute Details
#plaid_secret ⇒ Object (readonly)
Returns the value of attribute plaid_secret.
28 29 30 |
# File 'lib/plaid/http/auth/plaid_secret.rb', line 28 def plaid_secret @plaid_secret end |
Class Method Details
.from_env ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/plaid/http/auth/plaid_secret.rb', line 36 def self.from_env plaid_secret = ENV['PLAID_SECRET_PLAID_SECRET'] all_nil = [ plaid_secret ].all?(&:nil?) return nil if all_nil new(plaid_secret: plaid_secret) end |
Instance Method Details
#clone_with(plaid_secret: nil) ⇒ Object
46 47 48 49 50 |
# File 'lib/plaid/http/auth/plaid_secret.rb', line 46 def clone_with(plaid_secret: nil) plaid_secret ||= self.plaid_secret PlaidSecretCredentials.new(plaid_secret: plaid_secret) end |