class Segurofacil::Responses::Response

Constants

HTTP_SUCCESS

Attributes

raw_body[R]
status_code[R]

Public Class Methods

new(response) click to toggle source
# File lib/segurofacil/responses/response.rb, line 9
def initialize(response)
  @status_code = response.fetch(:code)
  @raw_body = response.fetch(:body)
end

Public Instance Methods

error?() click to toggle source
# File lib/segurofacil/responses/response.rb, line 18
def error?
  !success?
end
success?() click to toggle source
# File lib/segurofacil/responses/response.rb, line 14
def success?
  HTTP_SUCCESS.include? status_code
end