Class: Spotify::SDK
- Inherits:
-
Object
- Object
- Spotify::SDK
- Defined in:
- lib/spotify/sdk.rb,
lib/spotify/sdk/me.rb,
lib/spotify/sdk/base.rb,
lib/spotify/sdk/item.rb,
lib/spotify/sdk/album.rb,
lib/spotify/sdk/image.rb,
lib/spotify/sdk/model.rb,
lib/spotify/sdk/artist.rb,
lib/spotify/sdk/connect.rb,
lib/spotify/sdk/me/info.rb,
lib/spotify/sdk/connect/device.rb,
lib/spotify/sdk/connect/playback_state.rb
Overview
Spotify::SDK contains the complete Ruby DSL to interact with the Spotify Platform.
Defined Under Namespace
Classes: Album, Artist, Base, Connect, Image, Item, Me, Model
Constant Summary collapse
- SDK_COMPONENTS =
This is where we mount new SDK components to the Spotify::SDK object. Simply add a key (this is your identifier) with the value being the object.
Notes:
-
Make sure your SDK component is being loaded at the top of this page.
-
You can name your identifier whatever you want:
-
This will be what people will use to call your code
-
For example: it would be the ‘connect` in `Spotify::SDK.new(@session).connect`
-
-
We’ll call .new on your class, providing one parameter being the instance of this SDK (aka self).
-
Make sure to a test for it in spec/lib/spotify/sdk_spec.rb (see how we did it for others)
-
{ connect: Spotify::SDK::Connect, me: Spotify::SDK::Me }.freeze
Instance Attribute Summary collapse
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
-
#initialize(session) ⇒ SDK
constructor
Initialize the Spotify SDK object.
-
#inspect ⇒ Object
:nodoc:.
Constructor Details
Instance Attribute Details
#session ⇒ Object (readonly)
Returns the value of attribute session.
55 56 57 |
# File 'lib/spotify/sdk.rb', line 55 def session @session end |
Instance Method Details
#inspect ⇒ Object
:nodoc:
57 58 59 |
# File 'lib/spotify/sdk.rb', line 57 def inspect # :nodoc: "#<%s:0x00%x>" % [self.class.name, (object_id << 1)] end |