Class: Verizon::OAuth2Credentials
- Inherits:
-
Object
- Object
- Verizon::OAuth2Credentials
- Defined in:
- lib/verizon/http/auth/oauth_2.rb
Overview
Data class for OAuth2Credentials.
Instance Attribute Summary collapse
-
#oauth_client_id ⇒ Object
readonly
Returns the value of attribute oauth_client_id.
-
#oauth_client_secret ⇒ Object
readonly
Returns the value of attribute oauth_client_secret.
-
#oauth_scopes ⇒ Object
readonly
Returns the value of attribute oauth_scopes.
-
#oauth_token ⇒ Object
readonly
Returns the value of attribute oauth_token.
Instance Method Summary collapse
- #clone_with(oauth_client_id: nil, oauth_client_secret: nil, oauth_token: nil, oauth_scopes: nil) ⇒ Object
-
#initialize(oauth_client_id:, oauth_client_secret:, oauth_token: nil, oauth_scopes: nil) ⇒ OAuth2Credentials
constructor
A new instance of OAuth2Credentials.
Constructor Details
#initialize(oauth_client_id:, oauth_client_secret:, oauth_token: nil, oauth_scopes: nil) ⇒ OAuth2Credentials
Returns a new instance of OAuth2Credentials.
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/verizon/http/auth/oauth_2.rb', line 73 def initialize(oauth_client_id:, oauth_client_secret:, oauth_token: nil, oauth_scopes: nil) raise ArgumentError, 'oauth_client_id cannot be nil' if oauth_client_id.nil? raise ArgumentError, 'oauth_client_secret cannot be nil' if oauth_client_secret.nil? @oauth_client_id = oauth_client_id @oauth_client_secret = oauth_client_secret @oauth_token = oauth_token @oauth_scopes = oauth_scopes end |
Instance Attribute Details
#oauth_client_id ⇒ Object (readonly)
Returns the value of attribute oauth_client_id.
70 71 72 |
# File 'lib/verizon/http/auth/oauth_2.rb', line 70 def oauth_client_id @oauth_client_id end |
#oauth_client_secret ⇒ Object (readonly)
Returns the value of attribute oauth_client_secret.
70 71 72 |
# File 'lib/verizon/http/auth/oauth_2.rb', line 70 def oauth_client_secret @oauth_client_secret end |
#oauth_scopes ⇒ Object (readonly)
Returns the value of attribute oauth_scopes.
70 71 72 |
# File 'lib/verizon/http/auth/oauth_2.rb', line 70 def oauth_scopes @oauth_scopes end |
#oauth_token ⇒ Object (readonly)
Returns the value of attribute oauth_token.
70 71 72 |
# File 'lib/verizon/http/auth/oauth_2.rb', line 70 def oauth_token @oauth_token end |
Instance Method Details
#clone_with(oauth_client_id: nil, oauth_client_secret: nil, oauth_token: nil, oauth_scopes: nil) ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/verizon/http/auth/oauth_2.rb', line 84 def clone_with(oauth_client_id: nil, oauth_client_secret: nil, oauth_token: nil, oauth_scopes: nil) oauth_client_id ||= self.oauth_client_id oauth_client_secret ||= self.oauth_client_secret oauth_token ||= self.oauth_token oauth_scopes ||= self.oauth_scopes OAuth2Credentials.new(oauth_client_id: oauth_client_id, oauth_client_secret: oauth_client_secret, oauth_token: oauth_token, oauth_scopes: oauth_scopes) end |