Class: RubyWolf::Handler
- Inherits:
-
Object
- Object
- RubyWolf::Handler
- Defined in:
- lib/ruby_wolf/handler.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(app, connection, &callback) ⇒ Handler
constructor
A new instance of Handler.
- #process ⇒ Object
Constructor Details
#initialize(app, connection, &callback) ⇒ Handler
Returns a new instance of Handler.
7 8 9 10 11 12 13 14 |
# File 'lib/ruby_wolf/handler.rb', line 7 def initialize(app, connection, &callback) @app = app @env = {} @connection = connection @response = '' @callback = callback end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
5 6 7 |
# File 'lib/ruby_wolf/handler.rb', line 5 def app @app end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
5 6 7 |
# File 'lib/ruby_wolf/handler.rb', line 5 def connection @connection end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
5 6 7 |
# File 'lib/ruby_wolf/handler.rb', line 5 def env @env end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/ruby_wolf/handler.rb', line 5 def response @response end |
Instance Method Details
#process ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ruby_wolf/handler.rb', line 16 def process prepare_rack_env log_request process_request compose_response log_response @callback.call(response) if @callback @response end |