Class: AlexaRuby::AudioPlayerRequest

Inherits:
BaseRequest show all
Defined in:
lib/alexa_ruby/request/audio_player_request.rb

Overview

Alexa “AudioPlayer” and “PlaybackController” request type

Instance Attribute Summary collapse

Attributes inherited from BaseRequest

#certificates_chain_url, #context, #id, #locale, #session, #signature, #timestamp, #type, #version

Instance Method Summary collapse

Methods inherited from BaseRequest

#json, #valid?

Constructor Details

#initialize(request) ⇒ AudioPlayerRequest

Initialize new AudioPlayer request

Parameters:

  • request (Hash)

    valid request from Amazon Alexa service


10
11
12
13
14
15
16
17
# File 'lib/alexa_ruby/request/audio_player_request.rb', line 10

def initialize(request)
  @type = :audio_player
  super
  req = @req[:request]
  @playback_state = req[:type].gsub!('AudioPlayer.', '')
  @playback_offset = current_offset(req)
  define_error_params(req) if @playback_state == 'PlaybackFailed'
end

Instance Attribute Details

#error_messageObject (readonly)

Returns the value of attribute error_message


4
5
6
# File 'lib/alexa_ruby/request/audio_player_request.rb', line 4

def error_message
  @error_message
end

#error_playback_tokenObject (readonly)

Returns the value of attribute error_playback_token


4
5
6
# File 'lib/alexa_ruby/request/audio_player_request.rb', line 4

def error_playback_token
  @error_playback_token
end

#error_player_activityObject (readonly)

Returns the value of attribute error_player_activity


4
5
6
# File 'lib/alexa_ruby/request/audio_player_request.rb', line 4

def error_player_activity
  @error_player_activity
end

#error_typeObject (readonly)

Returns the value of attribute error_type


4
5
6
# File 'lib/alexa_ruby/request/audio_player_request.rb', line 4

def error_type
  @error_type
end

#playback_offsetObject (readonly)

Returns the value of attribute playback_offset


4
5
6
# File 'lib/alexa_ruby/request/audio_player_request.rb', line 4

def playback_offset
  @playback_offset
end

#playback_stateObject (readonly)

Returns the value of attribute playback_state


4
5
6
# File 'lib/alexa_ruby/request/audio_player_request.rb', line 4

def playback_state
  @playback_state
end