Class: Ezframe::Server
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize ⇒ Server
constructor
A new instance of Server.
Constructor Details
#initialize ⇒ Server
Returns a new instance of Server.
5 6 7 |
# File 'lib/ezframe/server.rb', line 5 def initialize Controller.init end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/ezframe/server.rb', line 9 def call(env) req = Rack::Request.new(env) res = Rack::Response.new Controller.exec(req, res) if res.body.empty? raise "no body in response" end return res.finish end |