Class: Spotify::SDK::Model
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Spotify::SDK::Model
- Defined in:
- lib/spotify/sdk/model.rb
Overview
For each SDK response object (i.e. Device), we have a Model class. We’re using OpenStruct.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
A reference to Spotify::SDK::Connect, so we can also do stuff.
Instance Method Summary collapse
-
#initialize(payload, parent) ⇒ Model
constructor
Initialize a new Model instance.
Constructor Details
#initialize(payload, parent) ⇒ Model
Initialize a new Model instance.
15 16 17 18 19 20 21 22 23 |
# File 'lib/spotify/sdk/model.rb', line 15 def initialize(payload, parent) @payload = payload validate_payload @parent = parent validate_parent super(payload) end |
Instance Attribute Details
#parent ⇒ Object (readonly)
A reference to Spotify::SDK::Connect, so we can also do stuff.
28 29 30 |
# File 'lib/spotify/sdk/model.rb', line 28 def parent @parent end |