123456789_123456789_123456789_123456789_123456789_

Class: Rack::Lint::Wrapper::ResponseFinishedWrapper

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: lib/rack/lint.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(wrapper, callback) ⇒ ResponseFinishedWrapper

[ GitHub ]

  
# File 'lib/rack/lint.rb', line 484

def initialize(wrapper, callback)
  @wrapper = wrapper
  @callback = callback
end

Instance Method Details

#call(env, status, headers, error)

[ GitHub ]

  
# File 'lib/rack/lint.rb', line 489

def call(env, status, headers, error)
  ## * <tt>env</tt> a valid Rack environment
  @wrapper.check_environment(env)

  ## * <tt>status</tt> a valid Rack status (or nil)
  status.nil? || @wrapper.check_status(status)

  ## * <tt>headers</tt> valid Rack response headers (or nil)
  headers.nil? || @wrapper.check_headers(headers)

  ## * <tt>error</tt> an Exception (or nil)
  unless error.nil? || Exception === error
    raise LintError, "rack.response_finished callable's fourth argument must be an Exception or nil, got #{error}"
  end

  @callback.call(env, status, headers, error)
end