class TelephoneAppointments::Response

Attributes

response[R]

Public Class Methods

new(response) click to toggle source
# File lib/telephone_appointments/response.rb, line 3
def initialize(response)
  @response = response
end

Public Instance Methods

errors() click to toggle source
# File lib/telephone_appointments/response.rb, line 11
def errors
  return {} if success? || response.body.nil? || response.body == ''
  JSON.parse(response.body)
end
success?() click to toggle source
# File lib/telephone_appointments/response.rb, line 7
def success?
  response.is_a? Net::HTTPSuccess
end