class Twilio::REST::Pricing::V2
Public Class Methods
new(domain)
click to toggle source
Initialize the V2
version of Pricing
Calls superclass method
Twilio::REST::Version::new
# File lib/twilio-ruby/rest/pricing/v2.rb 15 def initialize(domain) 16 super 17 @version = 'v2' 18 @countries = nil 19 @numbers = nil 20 @voice = nil 21 end
Public Instance Methods
countries(iso_country=:unset)
click to toggle source
@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 [Twilio::REST::Pricing::V2::CountryContext] if iso_country was passed. @return [Twilio::REST::Pricing::V2::CountryList]
# File lib/twilio-ruby/rest/pricing/v2.rb 29 def countries(iso_country=:unset) 30 if iso_country.nil? 31 raise ArgumentError, 'iso_country cannot be nil' 32 end 33 if iso_country == :unset 34 @countries ||= CountryList.new self 35 else 36 CountryContext.new(self, iso_country) 37 end 38 end
numbers(destination_number=:unset)
click to toggle source
@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 [Twilio::REST::Pricing::V2::NumberContext] if destination_number was passed. @return [Twilio::REST::Pricing::V2::NumberList]
# File lib/twilio-ruby/rest/pricing/v2.rb 47 def numbers(destination_number=:unset) 48 if destination_number.nil? 49 raise ArgumentError, 'destination_number cannot be nil' 50 end 51 if destination_number == :unset 52 @numbers ||= NumberList.new self 53 else 54 NumberContext.new(self, destination_number) 55 end 56 end
to_s()
click to toggle source
Provide a user friendly representation
# File lib/twilio-ruby/rest/pricing/v2.rb 66 def to_s 67 '<Twilio::REST::Pricing::V2>' 68 end
voice()
click to toggle source
@return [Twilio::REST::Pricing::V2::VoiceContext]
# File lib/twilio-ruby/rest/pricing/v2.rb 60 def voice 61 @voice ||= VoiceList.new self 62 end