Class: PhraseParser::Operator

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

Class Method Summary collapse

Class Method Details

.symbol(str) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/doing/phrase_parser.rb', line 37

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