Class: Rtlog::Entry
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
- #logger ⇒ Object
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #==(v) ⇒ Object
- #date ⇒ Object
-
#initialize(config, path) ⇒ Entry
constructor
A new instance of Entry.
Methods included from DirUtils
Constructor Details
#initialize(config, path) ⇒ Entry
Returns a new instance of Entry.
127 128 129 130 131 |
# File 'lib/rtlog/archives.rb', line 127 def initialize config, path @config = config @path = path @date = nil end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
123 124 125 |
# File 'lib/rtlog/archives.rb', line 123 def config @config end |
#logger ⇒ Object
145 146 147 |
# File 'lib/rtlog/archives.rb', line 145 def logger defined?(@logger) ? @logger : Rtlog.logger end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
124 125 126 |
# File 'lib/rtlog/archives.rb', line 124 def path @path end |
Instance Method Details
#==(v) ⇒ Object
140 141 142 143 |
# File 'lib/rtlog/archives.rb', line 140 def ==(v) return false if v.respond_to?(:path) self.path == v.path end |
#date ⇒ Object
133 134 135 136 137 138 |
# File 'lib/rtlog/archives.rb', line 133 def date unless @date @date = Time.zone.local( *path.split('/').last(date_split_size).collect{|v| v.to_i } ) end @date end |