class Ralyxa::ResponseEntities::Directives::AudioPlayer::Play

Constants

CLEAR_ENQUEUE
ENQUEUE
REPLACE_ALL
REPLACE_ENQUEUED

Public Class Methods

as_hash(stream, behaviour = nil) click to toggle source
# File lib/ralyxa/response_entities/directives/audio_player/play.rb, line 25
def self.as_hash(stream, behaviour = nil)
  new(stream, behaviour).to_h
end
new(stream, behaviour = Ralyxa::ResponseEntities::Directives::AudioPlayer::Play::REPLACE_ALL) click to toggle source
# File lib/ralyxa/response_entities/directives/audio_player/play.rb, line 11
def initialize(stream, behaviour = Ralyxa::ResponseEntities::Directives::AudioPlayer::Play::REPLACE_ALL)
  @stream    = stream
  @behaviour = behaviour
end

Public Instance Methods

to_h() click to toggle source
# File lib/ralyxa/response_entities/directives/audio_player/play.rb, line 16
def to_h
  {}.tap do |audio_player|
    audio_player['type'] = 'AudioPlayer.Play'
    audio_player['playBehavior'] = @behaviour

    audio_player['audioItem'] = Ralyxa::ResponseEntities::Directives::Audio::AudioItem.new(@stream).to_h
  end
end