Module: StringScorer

Defined in:
lib/string_scorer/scorer.rb

Class Method Summary collapse

Class Method Details

.[](id) ⇒ Object



11
12
13
# File 'lib/string_scorer/scorer.rb', line 11

def [](id)
  scorers[id.to_sym] || raise("No such scoring algorithm")
end

.[]=(id, klass) ⇒ Object



7
8
9
# File 'lib/string_scorer/scorer.rb', line 7

def []=(id, klass)
  register(id, klass)
end

.register(id, klass) ⇒ Object



3
4
5
# File 'lib/string_scorer/scorer.rb', line 3

def register(id, klass)
  scorers[id.to_sym] = klass
end