Class: ObjectsFramework::Object
- Inherits:
-
Object
- Object
- ObjectsFramework::Object
- Defined in:
- lib/objectsframework/object.rb
Constant Summary collapse
- @@hooks =
Object hooks: Usage: add_hook :filter => “afilter”, :method => “yourmethod” Available hooks/filters (some are not implement yet, but planned):
-
object.before_execute: fired before your request handling method is called
-
request.finished: fired when the request is finished and the response is about to get served [planned]
-
server.ready: fired when the server is ready accepting connections [planned]
-
server.error: fired when an internal error happens (for example method not found) [planned]
-
request.capture: capture the request before anything happens, like a real pirate! (fired after your object is created)
if the result of your hook returns true, the request must be finished by your hook this can block the request
All hooks are blocking, so they could eventually block the request [Future testing required]
-
[]
Class Method Summary collapse
Instance Method Summary collapse
- #continue ⇒ Object
- #request ⇒ Object
- #response ⇒ Object
- #set_instance_variables(request, response, env) ⇒ Object
Class Method Details
.add_hook(hook) ⇒ Object
37 38 39 |
# File 'lib/objectsframework/object.rb', line 37 def self.add_hook(hook) @@hooks << hook end |
.get_hooks ⇒ Object
33 34 35 |
# File 'lib/objectsframework/object.rb', line 33 def self.get_hooks @@hooks end |
Instance Method Details
#continue ⇒ Object
16 17 18 |
# File 'lib/objectsframework/object.rb', line 16 def continue return 0 end |
#request ⇒ Object
8 9 10 |
# File 'lib/objectsframework/object.rb', line 8 def request @request end |
#response ⇒ Object
12 13 14 |
# File 'lib/objectsframework/object.rb', line 12 def response @response end |
#set_instance_variables(request, response, env) ⇒ Object
3 4 5 6 |
# File 'lib/objectsframework/object.rb', line 3 def set_instance_variables(request,response,env) @request,@response,@env = request,response,env return self; end |