Class: Cuca::Sandbox
- Inherits:
-
Object
- Object
- Cuca::Sandbox
- Defined in:
- lib/cuca/app.rb,
lib/cuca/app_cgi.rb
Overview
Sandbox is used internally run the action script defined by the controller In future this can be extended to implement some security features etc..
Class Method Summary collapse
Class Method Details
.run(controller_class_name, mod, assigns, request_method, subcall) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/cuca/app.rb', line 19 def self.run(controller_class_name, mod, assigns, request_method, subcall) self.class.send(:include, mod) controller_class = mod::const_get(controller_class_name) controller = controller_class.send(:new, :assigns=>assigns) $controller_object = controller controller.run_before_filters case request_method when 'POST' controller.send('_do'.intern, 'run', subcall) controller.send('_do'.intern, 'post', subcall) when 'GET' controller.send('_do'.intern, 'run', subcall) controller.send('_do'.intern, 'get', subcall) when 'PUT' controller.send('_do'.intern, 'put', subcall) when 'PATCH' controller.send('_do'.intern, 'patch', subcall) when 'HEAD' controller.send('_do'.intern, 'head', subcall) when 'DELETE' controller.send('_do'.intern, 'delete', subcall) end controller.run_after_filters return [controller.http_status, controller.mime_type, controller.to_s, controller.http_header] end |