Class: Spotify::SDK::Initialization::Base
- Inherits:
-
Object
- Object
- Spotify::SDK::Initialization::Base
- Defined in:
- lib/spotify/sdk/initialization/base.rb
Overview
For each SDK Initialization type, we have a base class to inherit from.
Direct Known Subclasses
OAuthAccessToken, PlainString, QueryHash, QueryString, URLString
Instance Attribute Summary collapse
-
#subject ⇒ Object
readonly
The subject of the class.
Instance Method Summary collapse
-
#initialize(subject) ⇒ Base
constructor
Initiate a Spotify SDK Initialization Base class.
-
#perform ⇒ Hash
Perform the class to extract the authentication details needed for the SDK class to run.
-
#should_perform? ⇒ Boolean
Determine whether this initialization type is valid, and should be performed.
Constructor Details
#initialize(subject) ⇒ Base
Initiate a Spotify SDK Initialization Base class. Note: You would not ever initiate this class, but rather inherit from it. See /lib/spotify/sdk/initialization/query_string.rb as an example.
20 21 22 |
# File 'lib/spotify/sdk/initialization/base.rb', line 20 def initialize(subject) @subject = subject end |
Instance Attribute Details
#subject ⇒ Object (readonly)
The subject of the class. Usually what has been sent to Spotify::SDK.new() is the subject.
57 58 59 |
# File 'lib/spotify/sdk/initialization/base.rb', line 57 def subject @subject end |
Instance Method Details
#perform ⇒ Hash
Perform the class to extract the authentication details needed for the SDK class to run.
46 47 48 49 50 51 52 |
# File 'lib/spotify/sdk/initialization/base.rb', line 46 def perform { access_token: nil, expires_in: nil, refresh_token: nil } end |
#should_perform? ⇒ Boolean
Determine whether this initialization type is valid, and should be performed.
33 34 35 |
# File 'lib/spotify/sdk/initialization/base.rb', line 33 def should_perform? false end |