Module: Fluent::TimeMixin::Parser

Included in:
Plugin::Parser
Defined in:
lib/fluent/time.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(mod) ⇒ Object



185
186
187
# File 'lib/fluent/time.rb', line 185

def self.included(mod)
  mod.include TimeParameters
end

Instance Method Details

#time_parser_create(type: @time_type, format: @time_format, timezone: @timezone, force_localtime: false) ⇒ Object



189
190
191
192
193
194
195
196
# File 'lib/fluent/time.rb', line 189

def time_parser_create(type: @time_type, format: @time_format, timezone: @timezone, force_localtime: false)
  return MixedTimeParser.new(type, format, @localtime, timezone, @utc, force_localtime, @time_format_fallbacks) if type == :mixed
  return NumericTimeParser.new(type) if type != :string
  return TimeParser.new(format, true, nil) if force_localtime

  localtime = @localtime && (timezone.nil? && !@utc)
  TimeParser.new(format, localtime, timezone)
end