Class: Twilio::TwilioResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/twilio-ruby/framework/twilio_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code, body) ⇒ TwilioResponse

Deprecated.

Use 'Twilio::Response' instead.

Returns a new instance of TwilioResponse.


8
9
10
11
12
13
# File 'lib/twilio-ruby/framework/twilio_response.rb', line 8

def initialize(status_code, body)
  warn "'Twilio::TwilioResponse' has been deprecated. Use 'Twilio::Response' instead."
  response = Twilio::Response.new(status_code, body)
  @status_code = response.status_code
  @body = response.body
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.


5
6
7
# File 'lib/twilio-ruby/framework/twilio_response.rb', line 5

def body
  @body
end

#status_codeObject

Returns the value of attribute status_code.


5
6
7
# File 'lib/twilio-ruby/framework/twilio_response.rb', line 5

def status_code
  @status_code
end

Instance Method Details

#to_sObject


15
16
17
# File 'lib/twilio-ruby/framework/twilio_response.rb', line 15

def to_s
  "[#{@status_code}] #{@body}"
end