Class: SpotifyWebApi::AuthorizationCodeAuthCredentials
- Inherits:
-
Object
- Object
- SpotifyWebApi::AuthorizationCodeAuthCredentials
- Defined in:
- lib/spotify_web_api/http/auth/o_auth2.rb
Overview
Data class for AuthorizationCodeAuthCredentials.
Instance Attribute Summary collapse
-
#o_auth_client_id ⇒ Object
readonly
Returns the value of attribute o_auth_client_id.
-
#o_auth_client_secret ⇒ Object
readonly
Returns the value of attribute o_auth_client_secret.
-
#o_auth_redirect_uri ⇒ Object
readonly
Returns the value of attribute o_auth_redirect_uri.
-
#o_auth_scopes ⇒ Object
readonly
Returns the value of attribute o_auth_scopes.
-
#o_auth_token ⇒ Object
readonly
Returns the value of attribute o_auth_token.
Instance Method Summary collapse
- #clone_with(o_auth_client_id: nil, o_auth_client_secret: nil, o_auth_redirect_uri: nil, o_auth_token: nil, o_auth_scopes: nil) ⇒ Object
-
#initialize(o_auth_client_id:, o_auth_client_secret:, o_auth_redirect_uri:, o_auth_token: nil, o_auth_scopes: nil) ⇒ AuthorizationCodeAuthCredentials
constructor
A new instance of AuthorizationCodeAuthCredentials.
Constructor Details
#initialize(o_auth_client_id:, o_auth_client_secret:, o_auth_redirect_uri:, o_auth_token: nil, o_auth_scopes: nil) ⇒ AuthorizationCodeAuthCredentials
Returns a new instance of AuthorizationCodeAuthCredentials.
116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/spotify_web_api/http/auth/o_auth2.rb', line 116 def initialize(o_auth_client_id:, o_auth_client_secret:, o_auth_redirect_uri:, o_auth_token: nil, o_auth_scopes: nil) raise ArgumentError, 'o_auth_client_id cannot be nil' if o_auth_client_id.nil? raise ArgumentError, 'o_auth_client_secret cannot be nil' if o_auth_client_secret.nil? raise ArgumentError, 'o_auth_redirect_uri cannot be nil' if o_auth_redirect_uri.nil? @o_auth_client_id = o_auth_client_id @o_auth_client_secret = o_auth_client_secret @o_auth_redirect_uri = o_auth_redirect_uri @o_auth_token = o_auth_token @o_auth_scopes = o_auth_scopes end |
Instance Attribute Details
#o_auth_client_id ⇒ Object (readonly)
Returns the value of attribute o_auth_client_id.
113 114 115 |
# File 'lib/spotify_web_api/http/auth/o_auth2.rb', line 113 def o_auth_client_id @o_auth_client_id end |
#o_auth_client_secret ⇒ Object (readonly)
Returns the value of attribute o_auth_client_secret.
113 114 115 |
# File 'lib/spotify_web_api/http/auth/o_auth2.rb', line 113 def o_auth_client_secret @o_auth_client_secret end |
#o_auth_redirect_uri ⇒ Object (readonly)
Returns the value of attribute o_auth_redirect_uri.
113 114 115 |
# File 'lib/spotify_web_api/http/auth/o_auth2.rb', line 113 def o_auth_redirect_uri @o_auth_redirect_uri end |
#o_auth_scopes ⇒ Object (readonly)
Returns the value of attribute o_auth_scopes.
113 114 115 |
# File 'lib/spotify_web_api/http/auth/o_auth2.rb', line 113 def o_auth_scopes @o_auth_scopes end |
#o_auth_token ⇒ Object (readonly)
Returns the value of attribute o_auth_token.
113 114 115 |
# File 'lib/spotify_web_api/http/auth/o_auth2.rb', line 113 def o_auth_token @o_auth_token end |
Instance Method Details
#clone_with(o_auth_client_id: nil, o_auth_client_secret: nil, o_auth_redirect_uri: nil, o_auth_token: nil, o_auth_scopes: nil) ⇒ Object
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/spotify_web_api/http/auth/o_auth2.rb', line 129 def clone_with(o_auth_client_id: nil, o_auth_client_secret: nil, o_auth_redirect_uri: nil, o_auth_token: nil, o_auth_scopes: nil) o_auth_client_id ||= self.o_auth_client_id o_auth_client_secret ||= self.o_auth_client_secret o_auth_redirect_uri ||= self.o_auth_redirect_uri o_auth_token ||= self.o_auth_token o_auth_scopes ||= self.o_auth_scopes AuthorizationCodeAuthCredentials.new( o_auth_client_id: o_auth_client_id, o_auth_client_secret: o_auth_client_secret, o_auth_redirect_uri: o_auth_redirect_uri, o_auth_token: o_auth_token, o_auth_scopes: o_auth_scopes ) end |