Class: Restcomm::REST::OutgoingCallerIds

Inherits:
ListResource show all
Defined in:
lib/restcomm-ruby/rest/outgoing_caller_ids.rb

Instance Method Summary collapse

Methods inherited from ListResource

#get, #initialize, #inspect, #list, #total

Methods included from Utils

#derestify, #restify

Constructor Details

This class inherits a constructor from Restcomm::REST::ListResource

Instance Method Details

#add(phone_number) ⇒ Object Also known as: verify



4
5
6
# File 'lib/restcomm-ruby/rest/outgoing_caller_ids.rb', line 4

def add(phone_number)
  create phone_number: phone_number
end

#create(params = {}) ⇒ Object

Override ListResource#create to instantiate the proper instance class. This doesn’t actually matter since all properties are lazily loaded into whatever object is instantiated. But it might matter in the future.



13
14
15
16
17
18
19
# File 'lib/restcomm-ruby/rest/outgoing_caller_ids.rb', line 13

def create(params={}) # :nodoc:
  old_instance_class = @instance_class
  @instance_class = Restcomm::REST::PhoneNumberVerificationRequest
  verification_request = super
  @instance_class = old_instance_class
  verification_request
end