Sha256: 5ecbac5484c7c962ea7726196e639ade9c879bc6f0330c7464025b600c1f66d3
Contents?: true
Size: 1.09 KB
Versions: 2
Compression:
Stored size: 1.09 KB
Contents
# Literal Node of AST (Abstract Syntax Tree) require 'time' module Fluent module FilterWhere class Parser class Literal attr_reader :text attr_reader :val def get(record) @val end end class BooleanLiteral < Literal 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 end class NumberLiteral < Literal def initialize(text) @text = text @val = Float(text) end end class StringLiteral < Literal def initialize(text) @text = text @val = text end end class IdentifierLiteral < Literal def initialize(text) @text = text end def get(record) record[@text] end def name @text end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
fluent-plugin-filter_where-1.0.3 | lib/fluent/plugin/filter_where/parser/literal.rb |
fluent-plugin-filter_where-1.0.2 | lib/fluent/plugin/filter_where/parser/literal.rb |