Class: VoiceML::MediaList

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

Overview

Paginated GET /Messages/{Sid}/Media response. Twilio's envelope key is media_list (not media) — the SDK preserves that on the wire.

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 = {}) ⇒ MediaList

Returns a new instance of MediaList.



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

def initialize(hash = {})
  assign_page_fields(hash)
  @media_list = (hash['media_list'] || []).map { |m| Media.from_hash(m) }
end

Instance Attribute Details

#media_listObject (readonly)

Returns the value of attribute media_list.



37
38
39
# File 'lib/voiceml/models/media.rb', line 37

def media_list
  @media_list
end

Class Method Details

.from_hash(hash) ⇒ Object



44
45
46
# File 'lib/voiceml/models/media.rb', line 44

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