Module: Hallon::Observable::Player

Included in:
Player
Defined in:
lib/hallon/observable/player.rb

Overview

We only care about a few of the Session callbacks, actually, but since this object is not really a Spotify object we do cheat a little bit.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(other) ⇒ Object

Includes Hallon::Observable for you.



7
8
9
# File 'lib/hallon/observable/player.rb', line 7

def self.extended(other)
  other.send(:include, Hallon::Observable)
end

Instance Method Details

#end_of_track_callback(session) ⇒ Object (protected)

Dummy callback. See Session#end_of_track_callback.



19
20
# File 'lib/hallon/observable/player.rb', line 19

def end_of_track_callback(session)
end

#initialize_callbacksArray<Method> (protected)

Returns array of callback methods.

Returns:

  • (Array<Method>)

    array of callback methods



14
15
16
# File 'lib/hallon/observable/player.rb', line 14

def initialize_callbacks
  %w(end_of_track streaming_error play_token_lost).map { |m| callback_for(m) }
end

#play_token_lost_callback(session) ⇒ Object (protected)

Dummy callback. See Session#play_token_lost_callback.



27
28
# File 'lib/hallon/observable/player.rb', line 27

def play_token_lost_callback(session)
end

#streaming_error_callback(session, error) ⇒ Object (protected)

Dummy callback. See Session#streaming_error_callback.



23
24
# File 'lib/hallon/observable/player.rb', line 23

def streaming_error_callback(session, error)
end