Module: Userlist::Push::Strategies

Defined in:
lib/userlist/push/strategies.rb,
lib/userlist/push/strategies/null.rb,
lib/userlist/push/strategies/direct.rb,
lib/userlist/push/strategies/threaded.rb,
lib/userlist/push/strategies/threaded/worker.rb

Defined Under Namespace

Classes: Direct, Null, Threaded

Class Method Summary collapse

Class Method Details

.strategy_for(strategy, config = {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/userlist/push/strategies.rb', line 8

def self.strategy_for(strategy, config = {})
  strategy = Userlist::Push::Strategies.const_get(strategy.to_s.capitalize) if strategy.is_a?(Symbol) || strategy.is_a?(String)

  strategy = strategy.new(config) if strategy.respond_to?(:new)

  strategy
end