Module: TShield::Controller::ClassMethods
- Defined in:
- lib/tshield/controller.rb
Overview
Implementation of actions
Instance Method Summary collapse
- #action(class_method, options) ⇒ Object
- #load_action(app, class_method, options) ⇒ Object
- #registered(app) ⇒ Object
Instance Method Details
#action(class_method, options) ⇒ Object
16 17 18 19 |
# File 'lib/tshield/controller.rb', line 16 def action(class_method, ) @actions = {} unless defined? @actions @actions[class_method] = end |
#load_action(app, class_method, options) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/tshield/controller.rb', line 27 def load_action(app, class_method, ) msg = "== registering #{[:path]}" msg << " for methods #{[:methods].join(',')}" msg << " with action #{class_method}" TShield.logger.info(msg) [:methods].each do |method| app.send(method, [:path]) do send(class_method, params, request) end end end |
#registered(app) ⇒ Object
21 22 23 24 25 |
# File 'lib/tshield/controller.rb', line 21 def registered(app) @actions.each do |class_method, | load_action(app, class_method, ) end end |