Class: AlexaRuby::AudioState

Inherits:
Object
  • Object
show all
Defined in:
lib/alexa_ruby/request/base_request/context/audio_state.rb

Overview

Audio state from context section in request

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(audio_state) ⇒ AudioState

Setup new AudioState object

Parameters:

  • audio_state (Hash)

    audio player state



9
10
11
12
13
# File 'lib/alexa_ruby/request/base_request/context/audio_state.rb', line 9

def initialize(audio_state)
  @token = audio_state[:token]
  @playback_offset = audio_state[:offsetInMilliseconds]
  @playback_state = audio_state[:playerActivity]
end

Instance Attribute Details

#playback_offsetObject (readonly)

Returns the value of attribute playback_offset.



4
5
6
# File 'lib/alexa_ruby/request/base_request/context/audio_state.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/base_request/context/audio_state.rb', line 4

def playback_state
  @playback_state
end

#tokenObject (readonly)

Returns the value of attribute token.



4
5
6
# File 'lib/alexa_ruby/request/base_request/context/audio_state.rb', line 4

def token
  @token
end