Class: Twilio::REST::Pricing::V1::PhoneNumberList::CountryContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, iso_country) ⇒ CountryContext

Initialize the CountryContext

Parameters:



138
139
140
141
142
143
144
145
146
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 138

def initialize(version, iso_country)
    super(version)

    # Path Solution
    @solution = { iso_country: iso_country,  }
    @uri = "/PhoneNumbers/Countries/#{@solution[:iso_country]}"

    
end

Instance Method Details

#fetchCountryInstance

Fetch the CountryInstance

Returns:



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 150

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    CountryInstance.new(
        @version,
        payload,
        iso_country: @solution[:iso_country],
    )
end

#inspectObject

Provide a detailed, user friendly representation



176
177
178
179
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 176

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Pricing.V1.CountryContext #{context}>"
end

#to_sObject

Provide a user friendly representation



169
170
171
172
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 169

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Pricing.V1.CountryContext #{context}>"
end