Class: TelephoneAppointments::Response
- Inherits:
-
Object
- Object
- TelephoneAppointments::Response
- Defined in:
- lib/telephone_appointments/response.rb
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
3 4 5 |
# File 'lib/telephone_appointments/response.rb', line 3 def initialize(response) @response = response end |
Instance Method Details
#errors ⇒ Object
11 12 13 14 |
# File 'lib/telephone_appointments/response.rb', line 11 def errors return {} if success? || response.body.nil? || response.body == '' JSON.parse(response.body) end |
#success? ⇒ Boolean
7 8 9 |
# File 'lib/telephone_appointments/response.rb', line 7 def success? response.is_a? Net::HTTPSuccess end |