Class: Verizon::ThingspaceOauthCredentials
- Inherits:
-
Object
- Object
- Verizon::ThingspaceOauthCredentials
- Defined in:
- lib/verizon/http/auth/thingspace_oauth.rb
Overview
Data class for ThingspaceOauthCredentials.
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_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) ⇒ Object
-
#initialize(oauth_client_id:, oauth_client_secret:, oauth_token: nil) ⇒ ThingspaceOauthCredentials
constructor
A new instance of ThingspaceOauthCredentials.
Constructor Details
#initialize(oauth_client_id:, oauth_client_secret:, oauth_token: nil) ⇒ ThingspaceOauthCredentials
Returns a new instance of ThingspaceOauthCredentials.
69 70 71 72 73 74 75 76 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 69 def initialize(oauth_client_id:, oauth_client_secret:, oauth_token: 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 end |
Instance Attribute Details
#oauth_client_id ⇒ Object (readonly)
Returns the value of attribute oauth_client_id.
67 68 69 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 67 def oauth_client_id @oauth_client_id end |
#oauth_client_secret ⇒ Object (readonly)
Returns the value of attribute oauth_client_secret.
67 68 69 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 67 def oauth_client_secret @oauth_client_secret end |
#oauth_token ⇒ Object (readonly)
Returns the value of attribute oauth_token.
67 68 69 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 67 def oauth_token @oauth_token end |
Instance Method Details
#clone_with(oauth_client_id: nil, oauth_client_secret: nil, oauth_token: nil) ⇒ Object
78 79 80 81 82 83 84 85 86 87 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 78 def clone_with(oauth_client_id: nil, oauth_client_secret: nil, oauth_token: nil) oauth_client_id ||= self.oauth_client_id oauth_client_secret ||= self.oauth_client_secret oauth_token ||= self.oauth_token ThingspaceOauthCredentials.new(oauth_client_id: oauth_client_id, oauth_client_secret: oauth_client_secret, oauth_token: oauth_token) end |