# File lib/fluent/mixin.rb, line 73 def self.configure(conf) if time_format = conf['time_format'] @time_format = time_format end if localtime = conf['localtime'] @localtime = true elsif utc = conf['utc'] @localtime = false end @timef = new(@time_format, @localtime) end
# File lib/fluent/mixin.rb, line 22 def initialize(format, localtime) @tc1 = 0 @tc1_str = nil @tc2 = 0 @tc2_str = nil if format if localtime define_singleton_method(:format_nocache) {|time| Time.at(time).strftime(format) } else define_singleton_method(:format_nocache) {|time| Time.at(time).utc.strftime(format) } end else if localtime define_singleton_method(:format_nocache) {|time| Time.at(time).iso8601 } else define_singleton_method(:format_nocache) {|time| Time.at(time).utc.iso8601 } end end end
Generated with the Darkfish Rdoc Generator 2.