Module: Derailleur::Handler::Rack

Included in:
RackHandler
Defined in:
lib/derailleur/core/handler.rb

Overview

Accessors, and to_rack_output for things behaving like RackHandler

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



15
16
17
# File 'lib/derailleur/core/handler.rb', line 15

def headers
  @headers
end

#pageObject

Returns the value of attribute page.



15
16
17
# File 'lib/derailleur/core/handler.rb', line 15

def page
  @page
end

#statusObject

Returns the value of attribute status.



15
16
17
# File 'lib/derailleur/core/handler.rb', line 15

def status
  @status
end

Instance Method Details

#initialize_rackObject

Sets to default values the Rack specification fields

200, {}, ”


25
26
27
28
29
# File 'lib/derailleur/core/handler.rb', line 25

def initialize_rack
  @status = 200
  @headers = {}
  @page = ''
end

#to_rack_outputObject

Returns an status, headers, and page array conforming to the Rack specification



19
20
21
# File 'lib/derailleur/core/handler.rb', line 19

def to_rack_output
  [status, headers, page]
end