Class: PhraseParser::Operator

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

Overview

Represents an operator

Class Method Summary collapse

Class Method Details

.symbol(str) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/doing/phrase_parser.rb', line 41

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