Class: Twilio::REST::Pricing::V1::VoiceList::CountryContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Pricing::V1::VoiceList::CountryContext
- Defined in:
- lib/twilio-ruby/rest/pricing/v1/voice/country.rb
Instance Method Summary collapse
-
#fetch ⇒ CountryInstance
Fetch a CountryInstance.
-
#initialize(version, iso_country) ⇒ CountryContext
constructor
Initialize the CountryContext.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, iso_country) ⇒ CountryContext
Initialize the CountryContext
149 150 151 152 153 154 155 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/country.rb', line 149 def initialize(version, iso_country) super(version) # Path Solution @solution = {iso_country: iso_country, } @uri = "/Voice/Countries/#{@solution[:iso_country]}" end |
Instance Method Details
#fetch ⇒ CountryInstance
Fetch a CountryInstance
160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/country.rb', line 160 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) CountryInstance.new(@version, payload, iso_country: @solution[:iso_country], ) end |
#to_s ⇒ Object
Provide a user friendly representation
174 175 176 177 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/country.rb', line 174 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Pricing.V1.CountryContext #{context}>" end |