Class: Mock::Twilio::ErrorHandler
- Inherits:
-
Object
- Object
- Mock::Twilio::ErrorHandler
- Defined in:
- lib/mock/twilio/util/error_handler.rb
Instance Method Summary collapse
-
#initialize(response) ⇒ ErrorHandler
constructor
A new instance of ErrorHandler.
- #raise ⇒ Object
Constructor Details
#initialize(response) ⇒ ErrorHandler
Returns a new instance of ErrorHandler.
6 7 8 |
# File 'lib/mock/twilio/util/error_handler.rb', line 6 def initialize(response) @response = response end |
Instance Method Details
#raise ⇒ Object
10 11 12 13 14 |
# File 'lib/mock/twilio/util/error_handler.rb', line 10 def raise return @response.body if @response.headers["content-type"].include?("application/json") @response.reason_phrase end |