Class: Serve::RackAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/serve/rack.rb

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ RackAdapter

Initialize a Rack endpoint for Serve with the root path to the views directory.



92
93
94
# File 'lib/serve/rack.rb', line 92

def initialize(root)
  @root = root
end

Instance Method Details

#call(env) ⇒ Object

Called by Rack to process a request.



97
98
99
100
101
# File 'lib/serve/rack.rb', line 97

def call(env)
  request = Request.new(env)
  response = Response.new()
  process(request, response).to_a
end