module TrailGuide::Algorithms

Public Class Methods

algorithm(algo) click to toggle source
# File lib/trail_guide/algorithms.rb, line 10
def self.algorithm(algo)
  case algo
  when :weighted
    algo = TrailGuide::Algorithms::Weighted
  when :bandit
    algo = TrailGuide::Algorithms::Bandit
  when :distributed
    algo = TrailGuide::Algorithms::Distributed
  when :random
    algo = TrailGuide::Algorithms::Random
  when :static
    algo = TrailGuide::Algorithms::Static
  else
    algo = algo.constantize if algo.is_a?(String)
  end
  algo
end