Skip to content

Instantly share code, notes, and snippets.

@mctaylorpants
Created December 19, 2017 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mctaylorpants/584617712ecd67f924ba16df0a281fd6 to your computer and use it in GitHub Desktop.
Save mctaylorpants/584617712ecd67f924ba16df0a281fd6 to your computer and use it in GitHub Desktop.
# Run the strategies for a given scope
def _run_strategies_for(scope, args) #:nodoc:
self.winning_strategy = @winning_strategies[scope]
return if winning_strategy && winning_strategy.halted?
# ...
(strategies || args).each do |name|
strategy = _fetch_strategy(name, scope)
next unless strategy && !strategy.performed? && strategy.valid?
strategy._run!
self.winning_strategy = @winning_strategies[scope] = strategy
break if strategy.halted?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment