Class: Pechkin::App
- Inherits:
-
Object
- Object
- Pechkin::App
- Defined in:
- lib/pechkin/app.rb
Overview
Rack application to handle requests
Instance Attribute Summary collapse
-
#handler ⇒ Object
Returns the value of attribute handler.
Instance Method Summary collapse
Instance Attribute Details
#handler ⇒ Object
Returns the value of attribute handler.
43 44 45 |
# File 'lib/pechkin/app.rb', line 43 def handler @handler end |
Instance Method Details
#call(env) ⇒ Object
45 46 47 48 49 50 |
# File 'lib/pechkin/app.rb', line 45 def call(env) RequestHandler.new(handler, env).handle rescue StandardError => e body = { status: 'error', reason: e. }.to_json ['503', { 'Content-Type' => 'application/json' }, [body]] end |