Class: Landline::Server
Overview
A specialized path that can be used directly as a Rack application.
Constant Summary collapse
- Context =
ServerContext
Instance Attribute Summary
Attributes inherited from Path
#bounce, #children, #pipeline, #properties
Attributes inherited from Node
Instance Method Summary collapse
-
#call(env) ⇒ Array(Integer,Hash,Array)
Rack ingress point.
-
#initialize(passthrough = nil, parent: nil, **opts, &setup) ⇒ Server
constructor
A new instance of Server.
Methods inherited from Path
#filter, #go, #postprocess, #preprocess, #process
Methods inherited from Node
Constructor Details
#initialize(passthrough = nil, parent: nil, **opts, &setup) ⇒ Server
Returns a new instance of Server.
16 17 18 19 20 21 22 |
# File 'lib/landline/server.rb', line 16 def initialize(passthrough = nil, parent: nil, **opts, &setup) super("", parent: parent, **opts, &setup) return if parent @passthrough = passthrough setup_properties(parent: nil, **opts) end |
Instance Method Details
#call(env) ⇒ Array(Integer,Hash,Array)
Rack ingress point.
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/landline/server.rb', line 27 def call(env) request = Landline::Request.new(env) response = handle_jumps(request) request.run_postprocessors(response) resp = response.finalize if resp[1][:"x-cascade"] and resp[0] == 404 and @passthrough @passthrough.call(request.env) else resp end end |