Class: VoiceML::StreamList

Inherits:
Object
  • Object
show all
Includes:
Pageable
Defined in:
lib/voiceml/models/streams.rb

Overview

Paginated ‘GET /Calls/Sid/Streams` response.

Constant Summary

Constants included from Pageable

Pageable::PAGE_FIELDS

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Pageable

#assign_page_fields

Constructor Details

#initialize(hash = {}) ⇒ StreamList

Returns a new instance of StreamList.



35
36
37
38
# File 'lib/voiceml/models/streams.rb', line 35

def initialize(hash = {})
  assign_page_fields(hash)
  @streams = (hash['streams'] || []).map { |s| Stream.from_hash(s) }
end

Instance Attribute Details

#streamsObject (readonly)

Returns the value of attribute streams.



33
34
35
# File 'lib/voiceml/models/streams.rb', line 33

def streams
  @streams
end

Class Method Details

.from_hash(hash) ⇒ Object



40
41
42
# File 'lib/voiceml/models/streams.rb', line 40

def self.from_hash(hash)
  new(hash || {})
end