Class: Query::Parser::Boolean

Inherits:
Language
  • Object
show all
Defined in:
lib/query/parser/boolean.rb

Instance Method Summary collapse

Instance Method Details

#rootObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/query/parser/boolean.rb', line 10

def root
  (
    (
      str("true") | str("t") | str("True") | str("TRUE") | str("T") |
        str("yes") | str("y") | str("Yes") | str("YES") | str("Y") |
        str("on") | str("On") | str("ON")
        str("false") | str("f") | str("False") | str("FALSE") |
          str("F") | str("no") | str("n") | str("No") | str("NO") |
          str("N") | str("off") | str("Off") | str("OFF")
    ) << special.present
  ).aka(:boolean)
end

#specialObject



6
7
8
# File 'lib/query/parser/boolean.rb', line 6

def special
  str("...") | str("..") | Whitespace | Operator
end