Class: Twilio::REST::Pricing::V1::PhoneNumberList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/pricing/v1/phone_number.rb,
lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb

Defined Under Namespace

Classes: CountryContext, CountryInstance, CountryList, CountryPage

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ PhoneNumberList

Initialize the PhoneNumberList

Parameters:

  • version (Version)

    Version that contains the resource


18
19
20
21
22
23
24
25
26
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number.rb', line 18

def initialize(version)
  super(version)

  # Path Solution
  @solution = {}

  # Components
  @countries = nil
end

Instance Method Details

#countries(iso_country = :unset) ⇒ CountryList, CountryContext

Access the countries

Parameters:

  • iso_country (String) (defaults to: :unset)

    The ISO country code of the pricing information to fetch.

Returns:

Raises:

  • (ArgumentError)

35
36
37
38
39
40
41
42
43
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number.rb', line 35

def countries(iso_country=:unset)
  raise ArgumentError, 'iso_country cannot be nil' if iso_country.nil?

  if iso_country != :unset
    return CountryContext.new(@version, iso_country, )
  end

    @countries ||= CountryList.new(@version, )
end

#to_sObject

Provide a user friendly representation


47
48
49
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number.rb', line 47

def to_s
  '#<Twilio.Pricing.V1.PhoneNumberList>'
end