Class: Fluent::FilterWhere::Parser::LogicalOpExp
- Defined in:
- lib/fluent/plugin/filter_where/parser/exp.rb
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Instance Method Summary collapse
- #eval(record) ⇒ Object
-
#initialize(left, right, operator) ⇒ LogicalOpExp
constructor
A new instance of LogicalOpExp.
Constructor Details
#initialize(left, right, operator) ⇒ LogicalOpExp
Returns a new instance of LogicalOpExp.
143 144 145 146 147 |
# File 'lib/fluent/plugin/filter_where/parser/exp.rb', line 143 def initialize(left, right, operator) @left = left @right = right @operator = operator end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
138 139 140 |
# File 'lib/fluent/plugin/filter_where/parser/exp.rb', line 138 def left @left end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
138 139 140 |
# File 'lib/fluent/plugin/filter_where/parser/exp.rb', line 138 def operator @operator end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
138 139 140 |
# File 'lib/fluent/plugin/filter_where/parser/exp.rb', line 138 def right @right end |
Instance Method Details
#eval(record) ⇒ Object
149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/fluent/plugin/filter_where/parser/exp.rb', line 149 def eval(record) l = left.eval(record) r = right.eval(record) case operator when :OR return l || r when :AND l && r else assert(false) false end end |