class Twilio::REST::Trunking::V1::TrunkContext::PhoneNumberContext
Public Class Methods
new(version, trunk_sid, sid)
click to toggle source
Initialize the PhoneNumberContext
@param [Version] version Version
that contains the resource @param [String] trunk_sid The SID of the Trunk from which to fetch the
PhoneNumber resource.
@param [String] sid The unique string that we created to identify the
PhoneNumber resource to fetch.
@return [PhoneNumberContext] PhoneNumberContext
Calls superclass method
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb 170 def initialize(version, trunk_sid, sid) 171 super(version) 172 173 # Path Solution 174 @solution = {trunk_sid: trunk_sid, sid: sid, } 175 @uri = "/Trunks/#{@solution[:trunk_sid]}/PhoneNumbers/#{@solution[:sid]}" 176 end
Public Instance Methods
delete()
click to toggle source
Delete the PhoneNumberInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb 190 def delete 191 @version.delete('DELETE', @uri) 192 end
fetch()
click to toggle source
Fetch the PhoneNumberInstance
@return [PhoneNumberInstance] Fetched PhoneNumberInstance
# File lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb 181 def fetch 182 payload = @version.fetch('GET', @uri) 183 184 PhoneNumberInstance.new(@version, payload, trunk_sid: @solution[:trunk_sid], sid: @solution[:sid], ) 185 end
inspect()
click to toggle source
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb 203 def inspect 204 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 205 "#<Twilio.Trunking.V1.PhoneNumberContext #{context}>" 206 end
to_s()
click to toggle source
Provide a user friendly representation
# File lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb 196 def to_s 197 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 198 "#<Twilio.Trunking.V1.PhoneNumberContext #{context}>" 199 end