class Twilio::REST::Pricing::V2::VoiceList::CountryContext
Public Class Methods
new(version, iso_country)
click to toggle source
Initialize the CountryContext
@param [Version] version Version
that contains the resource @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 [CountryContext] CountryContext
Calls superclass method
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/pricing/v2/voice/country.rb 151 def initialize(version, iso_country) 152 super(version) 153 154 # Path Solution 155 @solution = {iso_country: iso_country, } 156 @uri = "/Voice/Countries/#{@solution[:iso_country]}" 157 end
Public Instance Methods
fetch()
click to toggle source
Fetch the CountryInstance
@return [CountryInstance] Fetched CountryInstance
# File lib/twilio-ruby/rest/pricing/v2/voice/country.rb 162 def fetch 163 payload = @version.fetch('GET', @uri) 164 165 CountryInstance.new(@version, payload, iso_country: @solution[:iso_country], ) 166 end
inspect()
click to toggle source
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/pricing/v2/voice/country.rb 177 def inspect 178 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 179 "#<Twilio.Pricing.V2.CountryContext #{context}>" 180 end
to_s()
click to toggle source
Provide a user friendly representation
# File lib/twilio-ruby/rest/pricing/v2/voice/country.rb 170 def to_s 171 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 172 "#<Twilio.Pricing.V2.CountryContext #{context}>" 173 end