Method: RSpotify::Player#initialize
- Defined in:
- lib/rspotify/player.rb
#initialize(user, options = {}) ⇒ Player
Returns a new instance of Player.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rspotify/player.rb', line 4 def initialize(user, = {}) @user = user @repeat_state = ['repeat_state'] @shuffle_state = ['shuffle_state'] @progress = ['progress_ms'] = ['is_playing'] = ['currently_playing_type'] @context_type = .dig('context', 'type') @context_uri = .dig('context', 'uri') @track = if ['track'] Track.new ['track'] end @device = if ['device'] Device.new ['device'] end end |