class Twilio::REST::Pricing::V2::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/country.rb
150 def initialize(version, iso_country)
151   super(version)
152 
153   # Path Solution
154   @solution = {iso_country: iso_country, }
155   @uri = "/Trunking/Countries/#{@solution[:iso_country]}"
156 end

Public Instance Methods

fetch() click to toggle source

Fetch the CountryInstance @return [CountryInstance] Fetched CountryInstance

    # File lib/twilio-ruby/rest/pricing/v2/country.rb
161 def fetch
162   payload = @version.fetch('GET', @uri)
163 
164   CountryInstance.new(@version, payload, iso_country: @solution[:iso_country], )
165 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/pricing/v2/country.rb
176 def inspect
177   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
178   "#<Twilio.Pricing.V2.CountryContext #{context}>"
179 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/pricing/v2/country.rb
169 def to_s
170   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
171   "#<Twilio.Pricing.V2.CountryContext #{context}>"
172 end