Class: Fluent::FilterWhere::Parser::BooleanLiteral

Inherits:
Literal
  • Object
show all
Defined in:
lib/fluent/plugin/filter_where/parser/literal.rb

Instance Attribute Summary

Attributes inherited from Literal

#text, #val

Instance Method Summary collapse

Methods inherited from Literal

#get

Constructor Details

#initialize(text) ⇒ BooleanLiteral

Returns a new instance of BooleanLiteral.



17
18
19
20
21
22
23
24
25
26
# File 'lib/fluent/plugin/filter_where/parser/literal.rb', line 17

def initialize(text)
  @text = text
  if text.downcase == 'true'.freeze
    @val = true
  elsif text.downcase == 'false'.freeze
    @val = false
  else
    raise ConfigError.new("\"%s\" is not a Boolean literal" % text)
  end
end