class Rack::AcceptSetter

Constants

ACCEPT_KEY
VERSION

Public Class Methods

new(stack, accepts) click to toggle source
# File lib/rack/accept_setter.rb, line 6
def initialize(stack, accepts)
  @stack = stack
  @accepts = accepts
end

Public Instance Methods

call(previous_state) click to toggle source
# File lib/rack/accept_setter.rb, line 11
def call(previous_state)
  @state = previous_state
  @status, @headers, @body = stack.call(state)

  headers[ACCEPT_KEY] = accepts

  [status, headers, body]
end

Private Instance Methods

accepts() click to toggle source
# File lib/rack/accept_setter.rb, line 20
        def accepts
  @accepts.join(", ")
end
body() click to toggle source
# File lib/rack/accept_setter.rb, line 40
        def body
  @body
end
headers() click to toggle source
# File lib/rack/accept_setter.rb, line 32
        def headers
  @headers
end
stack() click to toggle source
# File lib/rack/accept_setter.rb, line 24
        def stack
  @stack
end
state() click to toggle source
# File lib/rack/accept_setter.rb, line 28
        def state
  @state
end
status() click to toggle source
# File lib/rack/accept_setter.rb, line 36
        def status
  @status
end