Class: VoiceML::CallList

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

Overview

Paginated ‘GET /Calls` 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 = {}) ⇒ CallList

Returns a new instance of CallList.



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

def initialize(hash = {})
  assign_page_fields(hash)
  @calls = (hash['calls'] || []).map { |c| Call.from_hash(c) }
end

Instance Attribute Details

#callsObject (readonly)

Returns the value of attribute calls.



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

def calls
  @calls
end

Class Method Details

.from_hash(hash) ⇒ Object



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

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