Class: Ralyxa::ResponseEntities::Directives::AudioPlayer::Play
- Inherits:
-
Object
- Object
- Ralyxa::ResponseEntities::Directives::AudioPlayer::Play
- Defined in:
- lib/ralyxa/response_entities/directives/audio_player/play.rb
Constant Summary collapse
- CLEAR_ENQUEUE =
'CLEAR_ENQUEUE'.freeze
- ENQUEUE =
'ENQUEUE'.freeze
- REPLACE_ALL =
'REPLACE_ALL'.freeze
- REPLACE_ENQUEUED =
'REPLACE_ENQUEUED'.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(stream, behaviour = Ralyxa::ResponseEntities::Directives::AudioPlayer::Play::REPLACE_ALL) ⇒ Play
constructor
A new instance of Play.
- #to_h ⇒ Object
Constructor Details
#initialize(stream, behaviour = Ralyxa::ResponseEntities::Directives::AudioPlayer::Play::REPLACE_ALL) ⇒ Play
Returns a new instance of Play.
11 12 13 14 |
# 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 |
Class Method Details
.as_hash(stream, behaviour = nil) ⇒ Object
25 26 27 |
# 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 |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 21 22 23 |
# 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 |