Class: EaseEngine::Log::RotateFile
Direct Known Subclasses
Instance Attribute Summary collapse
-
#max_size ⇒ Object
Returns the value of attribute max_size.
Attributes inherited from IO
Instance Method Summary collapse
-
#initialize(file, flags = FLAG_ALL, max_size = 1024 * 1024) ⇒ RotateFile
constructor
A new instance of RotateFile.
- #rotate(file_path) ⇒ Object
Methods inherited from IO
Constructor Details
#initialize(file, flags = FLAG_ALL, max_size = 1024 * 1024) ⇒ RotateFile
Returns a new instance of RotateFile.
33 34 35 36 37 |
# File 'lib/ease_engine/log.rb', line 33 def initialize( file, flags = FLAG_ALL, max_size = 1024 * 1024 ) super( file, flags ) @max_size = max_size end |
Instance Attribute Details
#max_size ⇒ Object
Returns the value of attribute max_size.
31 32 33 |
# File 'lib/ease_engine/log.rb', line 31 def max_size @max_size end |
Instance Method Details
#rotate(file_path) ⇒ Object
39 40 41 42 43 |
# File 'lib/ease_engine/log.rb', line 39 def rotate( file_path ) @file.rewind FileUtils.copy_stream( @file, file_path ) @file.truncate( 0 ) end |