Module: Cenit

Defined in:
lib/cenit/algorithms.rb,
lib/cenit/algorithms/version.rb,
lib/cenit/algorithms/rewriter.rb,
lib/cenit/algorithms/algorithm.rb,
lib/cenit/algorithms/namespace.rb,
lib/cenit/algorithms/interpreter.rb

Defined Under Namespace

Modules: Algorithms

Class Method Summary collapse

Class Method Details

.Algorithms(ns_or_criteria) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/cenit/algorithms.rb', line 10

def Algorithms(ns_or_criteria)
  case ns_or_criteria
  when String
    Algorithms::Namespace.new(ns_or_criteria)
  when Hash
    Cenit::Algorithms.find(ns_or_criteria)
  else
    fail "#{String} or #{Hash} expected but #{ns_or_criteria.class} found"
  end
end