Module: ActionInterceptor::Strategies
- Defined in:
- lib/action_interceptor/strategies.rb,
lib/action_interceptor/strategies/session.rb
Defined Under Namespace
Classes: Session
Class Method Summary collapse
- .find(controller, name) ⇒ Object
- .find_all(controller, names) ⇒ Object
- .register(name, strategy_class) ⇒ Object
Class Method Details
.find(controller, name) ⇒ Object
9 10 11 |
# File 'lib/action_interceptor/strategies.rb', line 9 def self.find(controller, name) @strategy_map[name].new(controller) end |
.find_all(controller, names) ⇒ Object
13 14 15 16 |
# File 'lib/action_interceptor/strategies.rb', line 13 def self.find_all(controller, names) names ||= ActionInterceptor.config.default_strategies names.collect{|name| find(controller, name)} end |
.register(name, strategy_class) ⇒ Object
4 5 6 7 |
# File 'lib/action_interceptor/strategies.rb', line 4 def self.register(name, strategy_class) @strategy_map ||= HashWithIndifferentAccess.new @strategy_map[name] = strategy_class end |