Class: BBServer::Server
- Inherits:
-
Object
- Object
- BBServer::Server
- Defined in:
- lib/bbserver/server.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(context) ⇒ Server
constructor
A new instance of Server.
Constructor Details
#initialize(context) ⇒ Server
Returns a new instance of Server.
6 7 8 |
# File 'lib/bbserver/server.rb', line 6 def initialize(context) @context = context end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bbserver/server.rb', line 10 def call(env) request = Request.new(env) response = Response.new router = Router.new(@context.routes) stack, params = router.match(request) http_context = HttpContext.new(@context, request, response, params) stack.execute(http_context) response.to_rack end |