Module: Fluent::Config::BasicParser::ClassMethods

Included in:
Fluent::Config::BasicParser
Defined in:
lib/fluent/config/basic_parser.rb

Instance Method Summary collapse

Instance Method Details

#def_literal(method_name, string) ⇒ Object



45
46
47
48
49
50
# File 'lib/fluent/config/basic_parser.rb', line 45

def def_literal(method_name, string)
  pattern = /#{string}#{LINE_END}/
  define_method(method_name) do
    skip(pattern) && string
  end
end

#def_symbol(method_name, string) ⇒ Object



38
39
40
41
42
43
# File 'lib/fluent/config/basic_parser.rb', line 38

def def_symbol(method_name, string)
  pattern = symbol(string)
  define_method(method_name) do
    skip(pattern) && string
  end
end

#symbol(string) ⇒ Object



34
35
36
# File 'lib/fluent/config/basic_parser.rb', line 34

def symbol(string)
  /#{Regexp.escape(string)}/
end