Class: Twilio::REST::Numbers::V2::HostedNumberOrderContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Numbers::V2::HostedNumberOrderContext
- Defined in:
- lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the HostedNumberOrderInstance.
-
#fetch ⇒ HostedNumberOrderInstance
Fetch the HostedNumberOrderInstance.
-
#initialize(version, sid) ⇒ HostedNumberOrderContext
constructor
Initialize the HostedNumberOrderContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ HostedNumberOrderContext
Initialize the HostedNumberOrderContext
229 230 231 232 233 234 235 236 237 |
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 229 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/HostedNumber/Orders/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the HostedNumberOrderInstance
241 242 243 244 245 246 |
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 241 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ HostedNumberOrderInstance
Fetch the HostedNumberOrderInstance
251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 251 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) HostedNumberOrderInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
273 274 275 276 |
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 273 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Numbers.V2.HostedNumberOrderContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
266 267 268 269 |
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 266 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Numbers.V2.HostedNumberOrderContext #{context}>" end |