Class: Twilio::REST::Pricing::V2::VoiceList

Inherits:
ListResource show all
Defined in:
lib/twilio-ruby/rest/pricing/v2/voice.rb,
lib/twilio-ruby/rest/pricing/v2/voice/number.rb,
lib/twilio-ruby/rest/pricing/v2/voice/country.rb

Defined Under Namespace

Classes: CountryContext, CountryInstance, CountryList, CountryPage, NumberContext, NumberInstance, NumberList, NumberPage

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ VoiceList

Initialize the VoiceList

Parameters:

  • version (Version)

    Version that contains the resource


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

def initialize(version)
  super(version)

  # Path Solution
  @solution = {}

  # Components
  @countries = nil
  @numbers = 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 origin-based voice pricing information to fetch.

Returns:

Raises:

  • (ArgumentError)

36
37
38
39
40
41
42
43
44
# File 'lib/twilio-ruby/rest/pricing/v2/voice.rb', line 36

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

#numbers(destination_number = :unset) ⇒ NumberList, NumberContext

Access the numbers

Parameters:

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

    The destination phone number, in E.164 format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number.

Returns:

Raises:

  • (ArgumentError)

54
55
56
57
58
59
60
61
62
# File 'lib/twilio-ruby/rest/pricing/v2/voice.rb', line 54

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

  if destination_number != :unset
    return NumberContext.new(@version, destination_number, )
  end

    @numbers ||= NumberList.new(@version, )
end

#to_sObject

Provide a user friendly representation


66
67
68
# File 'lib/twilio-ruby/rest/pricing/v2/voice.rb', line 66

def to_s
  '#<Twilio.Pricing.V2.VoiceList>'
end