Class: AlexaToolbox::AudioPlayer

Inherits:
Object
  • Object
show all
Defined in:
lib/alexa_toolbox/audioplayer.rb

Overview

Handles the audioplayer object in requests.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(audioplayer) ⇒ AudioPlayer

Returns a new instance of AudioPlayer.



6
7
8
9
10
11
12
# File 'lib/alexa_toolbox/audioplayer.rb', line 6

def initialize (audioplayer)
  @type = audioplayer.key?(:type) ? audioplayer[:type][12..-1] : ""
  @offset_in_milliseconds = audioplayer.key?(:offsetInMilliseconds) ? audioplayer[:offsetInMilliseconds] : nil
  @token = audioplayer.key?(:token) ? audioplayer[:token] : ""
  @current_playback_state = audioplayer.key?(:currentPlaybackState) ? audioplayer[:currentPlaybackState] : nil
  @json = audioplayer
end

Instance Attribute Details

#current_playback_stateObject (readonly)

Returns the value of attribute current_playback_state.



4
5
6
# File 'lib/alexa_toolbox/audioplayer.rb', line 4

def current_playback_state
  @current_playback_state
end

#errorObject (readonly)

Returns the value of attribute error.



4
5
6
# File 'lib/alexa_toolbox/audioplayer.rb', line 4

def error
  @error
end

#jsonObject (readonly)

Returns the value of attribute json.



4
5
6
# File 'lib/alexa_toolbox/audioplayer.rb', line 4

def json
  @json
end

#offset_in_millisecondsObject (readonly)

Returns the value of attribute offset_in_milliseconds.



4
5
6
# File 'lib/alexa_toolbox/audioplayer.rb', line 4

def offset_in_milliseconds
  @offset_in_milliseconds
end

#tokenObject (readonly)

Returns the value of attribute token.



4
5
6
# File 'lib/alexa_toolbox/audioplayer.rb', line 4

def token
  @token
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/alexa_toolbox/audioplayer.rb', line 4

def type
  @type
end