Sha256: e0fc728235c27cc1dec474fea77148c918f5198eaeeb70a7b3b7be07660edae8

Contents?: true

Size: 353 Bytes

Versions: 5

Compression:

Stored size: 353 Bytes

Contents

module TelephoneAppointments
  class Response
    def initialize(response)
      @response = response
    end

    def success?
      response.is_a? Net::HTTPSuccess
    end

    def errors
      return {} if success? || response.body.nil? || response.body == ''
      JSON.parse(response.body)
    end

    private

    attr_reader :response
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
telephone_appointments-0.3.0 lib/telephone_appointments/response.rb
telephone_appointments-0.2.1 lib/telephone_appointments/response.rb
telephone_appointments-0.2.0 lib/telephone_appointments/response.rb
telephone_appointments-0.1.1 lib/telephone_appointments/response.rb
telephone_appointments-0.1.0 lib/telephone_appointments/response.rb