Class: Twilio::REST::Pricing::V1::PhoneNumberList::CountryInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Pricing::V1::PhoneNumberList::CountryInstance
- Defined in:
- lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb
Instance Method Summary collapse
-
#context ⇒ CountryContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#country ⇒ String
The country.
-
#fetch ⇒ CountryInstance
Fetch a CountryInstance.
-
#initialize(version, payload, iso_country: nil) ⇒ CountryInstance
constructor
Initialize the CountryInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#iso_country ⇒ String
The iso_country.
-
#phone_number_prices ⇒ String
The phone_number_prices.
-
#price_unit ⇒ String
The price_unit.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, iso_country: nil) ⇒ CountryInstance
Initialize the CountryInstance
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 187 def initialize(version, payload, iso_country: nil) super(version) # Marshaled Properties @properties = { 'country' => payload['country'], 'iso_country' => payload['iso_country'], 'url' => payload['url'], 'phone_number_prices' => payload['phone_number_prices'], 'price_unit' => payload['price_unit'], } # Context @instance_context = nil @params = {'iso_country' => iso_country || @properties['iso_country'], } end |
Instance Method Details
#context ⇒ CountryContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
208 209 210 211 212 213 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 208 def context unless @instance_context @instance_context = CountryContext.new(@version, @params['iso_country'], ) end @instance_context end |
#country ⇒ String
217 218 219 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 217 def country @properties['country'] end |
#fetch ⇒ CountryInstance
Fetch a CountryInstance
248 249 250 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 248 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
261 262 263 264 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 261 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V1.CountryInstance #{values}>" end |
#iso_country ⇒ String
223 224 225 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 223 def iso_country @properties['iso_country'] end |
#phone_number_prices ⇒ String
229 230 231 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 229 def phone_number_prices @properties['phone_number_prices'] end |
#price_unit ⇒ String
235 236 237 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 235 def price_unit @properties['price_unit'] end |
#to_s ⇒ Object
Provide a user friendly representation
254 255 256 257 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 254 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V1.CountryInstance #{values}>" end |
#url ⇒ String
241 242 243 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 241 def url @properties['url'] end |