Class: VoiceML::RecordingList

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

Overview

‘GET /Recordings` (account-scoped) and `GET /Calls/Sid/Recordings` (per-call) response. The per-call form populates only `recordings`; pagination fields remain `nil`.

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

Returns a new instance of RecordingList.



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

def initialize(hash = {})
  assign_page_fields(hash)
  @recordings = (hash['recordings'] || []).map { |r| Recording.from_hash(r) }
end

Instance Attribute Details

#recordingsObject (readonly)

Returns the value of attribute recordings.



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

def recordings
  @recordings
end

Class Method Details

.from_hash(hash) ⇒ Object



42
43
44
# File 'lib/voiceml/models/recordings.rb', line 42

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