Class: Twilio::REST::Pricing::V2::CountryContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Pricing::V2::CountryContext
- Defined in:
- lib/twilio-ruby/rest/pricing/v2/country.rb
Instance Method Summary collapse
-
#fetch ⇒ CountryInstance
Fetch the CountryInstance.
-
#initialize(version, iso_country) ⇒ CountryContext
constructor
Initialize the CountryContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, iso_country) ⇒ CountryContext
Initialize the CountryContext
132 133 134 135 136 137 138 139 140 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 132 def initialize(version, iso_country) super(version) # Path Solution @solution = { iso_country: iso_country, } @uri = "/Trunking/Countries/#{@solution[:iso_country]}" end |
Instance Method Details
#fetch ⇒ CountryInstance
Fetch the CountryInstance
144 145 146 147 148 149 150 151 152 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 144 def fetch payload = @version.fetch('GET', @uri) CountryInstance.new( @version, payload, iso_country: @solution[:iso_country], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
164 165 166 167 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 164 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Pricing.V2.CountryContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
157 158 159 160 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 157 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Pricing.V2.CountryContext #{context}>" end |