Class: Mite::Server
- Inherits:
-
Object
- Object
- Mite::Server
- Defined in:
- lib/mite/server.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
Instance Method Summary collapse
-
#initialize(config:) ⇒ Server
constructor
A new instance of Server.
- #process(request) ⇒ Object
Constructor Details
#initialize(config:) ⇒ Server
Returns a new instance of Server.
5 6 7 8 9 10 11 12 |
# File 'lib/mite/server.rb', line 5 def initialize(config:) builder = %{ Rack::Builder.new do #{File.read(config)} end } @application = eval(builder, nil, config) end |
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
3 4 5 |
# File 'lib/mite/server.rb', line 3 def application @application end |
Instance Method Details
#process(request) ⇒ Object
14 15 16 |
# File 'lib/mite/server.rb', line 14 def process(request) application.call(request.merge("rack.errors" => $stderr, "rack.version" => Rack::VERSION)) end |