Class: Yell::Adapters::Datefile
- Defined in:
- lib/yell/adapters/datefile.rb
Overview
The Datefile
adapter is similar to the File
adapter. However, it rotates the file at midnight.
Constant Summary collapse
- DefaultDatePattern =
The default date pattern, e.g. “19820114” (14 Jan 1982)
"%Y%m%d"
Constants inherited from Io
Instance Attribute Summary
Attributes inherited from Io
Attributes inherited from Base
Instance Method Summary collapse
- #Reset(thefilehandle) ⇒ Object
-
#initialize(options = {}, &block) ⇒ Datefile
constructor
A new instance of Datefile.
Methods inherited from File
Methods inherited from Io
Methods inherited from Base
Constructor Details
#initialize(options = {}, &block) ⇒ Datefile
Returns a new instance of Datefile.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/yell/adapters/datefile.rb', line 13 def initialize( = {}, &block ) @date_pattern = [:date_pattern] || DefaultDatePattern @file_basename = [:filename] || default_filename [:filename] = @file_basename @date = nil # default; do not override --R super end |
Instance Method Details
#Reset(thefilehandle) ⇒ Object
25 26 27 28 29 |
# File 'lib/yell/adapters/datefile.rb', line 25 def close @filename = new_filename super end |