Class: Ralyxa::ResponseEntities::Directives::Audio::AudioItem

Inherits:
Object
  • Object
show all
Defined in:
lib/ralyxa/response_entities/directives/audio/audio_item.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream) ⇒ AudioItem

Returns a new instance of AudioItem.



6
7
8
# File 'lib/ralyxa/response_entities/directives/audio/audio_item.rb', line 6

def initialize(stream)
  @stream = stream
end

Class Method Details

.as_hash(stream) ⇒ Object



16
17
18
# File 'lib/ralyxa/response_entities/directives/audio/audio_item.rb', line 16

def self.as_hash(stream)
  new(stream).to_h
end

Instance Method Details

#to_hObject



10
11
12
13
14
# File 'lib/ralyxa/response_entities/directives/audio/audio_item.rb', line 10

def to_h
  {}.tap do |audio_item|
    audio_item['stream'] = @stream.to_h
  end
end