class Twilio::REST::Pricing::V2::VoiceList

Public Class Methods

new(version) click to toggle source

Initialize the VoiceList @param [Version] version Version that contains the resource @return [VoiceList] VoiceList

Calls superclass method Twilio::REST::ListResource::new
   # File lib/twilio-ruby/rest/pricing/v2/voice.rb
18 def initialize(version)
19   super(version)
20 
21   # Path Solution
22   @solution = {}
23 
24   # Components
25   @countries = nil
26   @numbers = nil
27 end

Public Instance Methods

countries(iso_country=:unset) click to toggle source

Access the countries @param [String] iso_country The {ISO country

code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the origin-based
voice pricing information to fetch.

@return [CountryList] @return [CountryContext] if iso_country was passed.

   # File lib/twilio-ruby/rest/pricing/v2/voice.rb
36 def countries(iso_country=:unset)
37   raise ArgumentError, 'iso_country cannot be nil' if iso_country.nil?
38 
39   if iso_country != :unset
40     return CountryContext.new(@version, iso_country, )
41   end
42 
43     @countries ||= CountryList.new(@version, )
44 end
numbers(destination_number=:unset) click to toggle source

Access the numbers @param [String] destination_number The destination phone number, in

{E.164}[https://www.twilio.com/docs/glossary/what-e164] 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.

@return [NumberList] @return [NumberContext] if destination_number was passed.

   # File lib/twilio-ruby/rest/pricing/v2/voice.rb
54 def numbers(destination_number=:unset)
55   raise ArgumentError, 'destination_number cannot be nil' if destination_number.nil?
56 
57   if destination_number != :unset
58     return NumberContext.new(@version, destination_number, )
59   end
60 
61     @numbers ||= NumberList.new(@version, )
62 end
to_s() click to toggle source

Provide a user friendly representation

   # File lib/twilio-ruby/rest/pricing/v2/voice.rb
66 def to_s
67   '#<Twilio.Pricing.V2.VoiceList>'
68 end