Class: VoiceML::IncomingPhoneNumberList

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

Overview

Paginated ‘GET /IncomingPhoneNumbers` response. Same envelope shape as `CallList`.

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

Returns a new instance of IncomingPhoneNumberList.



49
50
51
52
53
# File 'lib/voiceml/models/incoming_phone_numbers.rb', line 49

def initialize(hash = {})
  assign_page_fields(hash)
  @incoming_phone_numbers =
    (hash['incoming_phone_numbers'] || []).map { |n| IncomingPhoneNumber.from_hash(n) }
end

Instance Attribute Details

#incoming_phone_numbersObject (readonly)

Returns the value of attribute incoming_phone_numbers.



47
48
49
# File 'lib/voiceml/models/incoming_phone_numbers.rb', line 47

def incoming_phone_numbers
  @incoming_phone_numbers
end

Class Method Details

.from_hash(hash) ⇒ Object



55
56
57
# File 'lib/voiceml/models/incoming_phone_numbers.rb', line 55

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