Sha256: a8775366e9848bc62c395ad85d4066ae96d3e98d05dc104df84d4466fd14c888
Contents?: true
Size: 468 Bytes
Versions: 2
Compression:
Stored size: 468 Bytes
Contents
module OAS module LogCollector class LogFile attr_reader :name, :time def initialize(file_path) @name = File.basename(file_path) @time = Time.at(name[/.*\.log\.([0-9]+)\.?(.+)?$/, 1].to_i) end def timestamp @time.to_i end def year @time.strftime("%Y") end def month @time.strftime("%m") end def day @time.strftime("%d") end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
oas-log-collector-0.1.6 | lib/oas/log_collector/log_file.rb |
oas-log-collector-0.1.5 | lib/oas/log_collector/log_file.rb |