class Phenotype::ResponseHandler

Attributes

response[R]

Public Class Methods

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

Public Instance Methods

retry?() click to toggle source
# File lib/phenotype/response_handler.rb, line 11
def retry?
  valid_response? && not_found? && cascade?
end

Private Instance Methods

cascade?() click to toggle source
# File lib/phenotype/response_handler.rb, line 29
def cascade?
  response[1]['X-Cascade'].to_s == 'pass'
end
not_found?() click to toggle source
# File lib/phenotype/response_handler.rb, line 25
def not_found?
  response.first.to_i == 404
end
rack_response?() click to toggle source
# File lib/phenotype/response_handler.rb, line 21
def rack_response?
  response[0].is_a?(Numeric) && response[1].is_a?(Hash) && response[2].is_a?(Array)
end
valid_response?() click to toggle source
# File lib/phenotype/response_handler.rb, line 17
def valid_response?
  response.is_a?(Array) && rack_response?
end