Class: BooleanTermParser::Operator

Inherits:
Object
  • Object
show all
Defined in:
lib/doing/boolean_term_parser.rb

Class Method Summary collapse

Class Method Details

.symbol(str) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/doing/boolean_term_parser.rb', line 25

def self.symbol(str)
  case str
  when '+'
    :must
  when '-'
    :must_not
  when nil
    :should
  else
    raise "Unknown operator: #{str}"
  end
end