Class: Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryContext::NationalPage

Inherits:
Page
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb

Constant Summary

Constants inherited from Page

Page::META_KEYS

Instance Method Summary collapse

Methods inherited from Page

#each, #load_page, #next_page, #next_page_url, #previous_page, #previous_page_url, #process_response

Constructor Details

#initialize(version, response, solution) ⇒ NationalPage

Initialize the NationalPage

Parameters:

  • version (Version)

    Version that contains the resource

  • response (Response)

    Response from the API

  • solution (Hash)

    Path solution for the resource



338
339
340
341
342
343
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb', line 338

def initialize(version, response, solution)
  super(version, response)

  # Path Solution
  @solution = solution
end

Instance Method Details

#get_instance(payload) ⇒ NationalInstance

Build an instance of NationalInstance

Parameters:

  • payload (Hash)

    Payload response from the API

Returns:



349
350
351
352
353
354
355
356
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb', line 349

def get_instance(payload)
  NationalInstance.new(
      @version,
      payload,
      account_sid: @solution[:account_sid],
      country_code: @solution[:country_code],
  )
end

#to_sObject

Provide a user friendly representation



360
361
362
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb', line 360

def to_s
  '<Twilio.Api.V2010.NationalPage>'
end