Class: Twilio::REST::Pricing::V2
- Defined in:
- lib/twilio-ruby/rest/pricing/v2.rb,
lib/twilio-ruby/rest/pricing/v2/voice.rb,
lib/twilio-ruby/rest/pricing/v2/number.rb,
lib/twilio-ruby/rest/pricing/v2/country.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, VoiceInstance, VoiceList, VoicePage
Instance Attribute Summary
Attributes inherited from Version
Instance Method Summary collapse
- #countries(iso_country = :unset) ⇒ Twilio::REST::Pricing::V2::CountryContext, Twilio::REST::Pricing::V2::CountryList
-
#initialize(domain) ⇒ V2
constructor
Initialize the V2 version of Pricing.
- #numbers(destination_number = :unset) ⇒ Twilio::REST::Pricing::V2::NumberContext, Twilio::REST::Pricing::V2::NumberList
-
#to_s ⇒ Object
Provide a user friendly representation.
- #voice ⇒ Twilio::REST::Pricing::V2::VoiceList
Methods inherited from Version
#absolute_url, #create, #delete, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #stream, #update
Constructor Details
#initialize(domain) ⇒ V2
Initialize the V2 version of Pricing
21 22 23 24 25 26 27 |
# File 'lib/twilio-ruby/rest/pricing/v2.rb', line 21 def initialize(domain) super @version = 'v2' @countries = nil @numbers = nil @voice = nil end |
Instance Method Details
#countries(iso_country = :unset) ⇒ Twilio::REST::Pricing::V2::CountryContext, Twilio::REST::Pricing::V2::CountryList
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/twilio-ruby/rest/pricing/v2.rb', line 33 def countries(iso_country=:unset) if iso_country.nil? raise ArgumentError, 'iso_country cannot be nil' end if iso_country == :unset @countries ||= CountryList.new self else CountryContext.new(self, iso_country) end end |
#numbers(destination_number = :unset) ⇒ Twilio::REST::Pricing::V2::NumberContext, Twilio::REST::Pricing::V2::NumberList
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/twilio-ruby/rest/pricing/v2.rb', line 47 def numbers(destination_number=:unset) if destination_number.nil? raise ArgumentError, 'destination_number cannot be nil' end if destination_number == :unset @numbers ||= NumberList.new self else NumberContext.new(self, destination_number) end end |
#to_s ⇒ Object
Provide a user friendly representation
64 65 66 |
# File 'lib/twilio-ruby/rest/pricing/v2.rb', line 64 def to_s '<Twilio::REST::Pricing::V2>'; end |
#voice ⇒ Twilio::REST::Pricing::V2::VoiceList
59 60 61 |
# File 'lib/twilio-ruby/rest/pricing/v2.rb', line 59 def voice @voice ||= VoiceList.new self end |