class Flash::Integration::Response

Attributes

body[R]
headers[R]
request[R]
status[R]
time[R]

Public Class Methods

new(attributes) click to toggle source
# File lib/flash/integration/response.rb, line 8
def initialize(attributes)
  @request = attributes.fetch(:request)
  @status = attributes.fetch(:status)
  @headers = attributes[:headers] || {}
  @body = attributes[:body] || {}
  @time = attributes[:time] || Time.now.utc
end

Public Instance Methods

error?() click to toggle source
# File lib/flash/integration/response.rb, line 20
def error?
  !success?
end
success?() click to toggle source
# File lib/flash/integration/response.rb, line 16
def success?
  @status.between?(200, 299)
end