class Afterpay::HTTPService::Response

Attributes

body[R]

@attribute body @return [Hash] HTTP response body

headers[R]

@attribute headers @return [Hash] HTTP response headers

status[R]

@attribute status @return [Integer] HTTP response status

Public Class Methods

new(params = {}) click to toggle source

Creates Afterpay::HTTPService::Response instance @param [Hash] params hash of parameters @return [Afterpay::HTTPService::Response] Response instance

# File lib/afterpay/http_service/response.rb, line 23
def initialize(params = {})
  @status  = params[:status]
  @body    = params[:body]
  @headers = params[:headers]
end

Public Instance Methods

ok?() click to toggle source
# File lib/afterpay/http_service/response.rb, line 29
def ok?
  (200..201).cover?(status.to_i)
end