Class: RubyApp::Rack::Response

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

Instance Method Summary collapse

Constructor Details

#initialize(application) ⇒ Response

Returns a new instance of Response.



8
9
10
# File 'lib/ruby_app/rack/response.rb', line 8

def initialize(application)
  @application = application
end

Instance Method Details

#call(environment) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/ruby_app/rack/response.rb', line 12

def call(environment)
  RubyApp::Response.create!
  begin
    @application.call(environment)
    return RubyApp::Response.finish
  ensure
    RubyApp::Response.destroy!
  end
end