Class: Fluent::FilterWhere::Parser::BooleanLiteral
- Defined in:
- lib/fluent/plugin/filter_where/parser/literal.rb
Instance Attribute Summary
Attributes inherited from Literal
Instance Method Summary collapse
-
#initialize(text) ⇒ BooleanLiteral
constructor
A new instance of BooleanLiteral.
Methods inherited from Literal
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 |