Class: Fluent::FilterWhere::Parser::RegexpOpExp
- Inherits:
-
BinaryOpExp
- Object
- Exp
- BinaryOpExp
- Fluent::FilterWhere::Parser::RegexpOpExp
- Defined in:
- lib/fluent/plugin/filter_where/parser/exp.rb
Instance Attribute Summary collapse
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Attributes inherited from BinaryOpExp
Instance Method Summary collapse
- #eval(record) ⇒ Object
-
#initialize(left, right, operator) ⇒ RegexpOpExp
constructor
A new instance of RegexpOpExp.
Constructor Details
#initialize(left, right, operator) ⇒ RegexpOpExp
Returns a new instance of RegexpOpExp.
101 102 103 104 |
# File 'lib/fluent/plugin/filter_where/parser/exp.rb', line 101 def initialize(left, right, operator) super(left, right, operator) @pattern = Regexp.compile(right.val) end |
Instance Attribute Details
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
99 100 101 |
# File 'lib/fluent/plugin/filter_where/parser/exp.rb', line 99 def pattern @pattern end |
Instance Method Details
#eval(record) ⇒ Object
106 107 108 109 |
# File 'lib/fluent/plugin/filter_where/parser/exp.rb', line 106 def eval(record) l = left.get(record) !!@pattern.match(l) end |