Class: AlexaToolbox::AudioPlayer
- Inherits:
-
Object
- Object
- AlexaToolbox::AudioPlayer
- Defined in:
- lib/alexa_toolbox/audioplayer.rb
Overview
Handles the audioplayer object in requests.
Instance Attribute Summary collapse
-
#current_playback_state ⇒ Object
readonly
Returns the value of attribute current_playback_state.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#json ⇒ Object
readonly
Returns the value of attribute json.
-
#offset_in_milliseconds ⇒ Object
readonly
Returns the value of attribute offset_in_milliseconds.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(audioplayer) ⇒ AudioPlayer
constructor
A new instance of AudioPlayer.
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_state ⇒ Object (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 |
#error ⇒ Object (readonly)
Returns the value of attribute error.
4 5 6 |
# File 'lib/alexa_toolbox/audioplayer.rb', line 4 def error @error end |
#json ⇒ Object (readonly)
Returns the value of attribute json.
4 5 6 |
# File 'lib/alexa_toolbox/audioplayer.rb', line 4 def json @json end |
#offset_in_milliseconds ⇒ Object (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 |
#token ⇒ Object (readonly)
Returns the value of attribute token.
4 5 6 |
# File 'lib/alexa_toolbox/audioplayer.rb', line 4 def token @token end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/alexa_toolbox/audioplayer.rb', line 4 def type @type end |