Class: LogStash::Outputs::Qingstor::RotationPolicy::Size
- Defined in:
- lib/logstash/outputs/qingstor/rotation_policy.rb
Instance Method Summary collapse
-
#initialize(file_size, _) ⇒ Size
constructor
A new instance of Size.
- #needs_periodic? ⇒ Boolean
- #rotate?(file) ⇒ Boolean
- #to_s ⇒ Object
Methods inherited from Policy
Constructor Details
#initialize(file_size, _) ⇒ Size
Returns a new instance of Size.
42 43 44 45 |
# File 'lib/logstash/outputs/qingstor/rotation_policy.rb', line 42 def initialize(file_size, _) @file_size = file_size positive_check(@file_size) end |
Instance Method Details
#needs_periodic? ⇒ Boolean
51 |
# File 'lib/logstash/outputs/qingstor/rotation_policy.rb', line 51 def needs_periodic?; false; end |
#rotate?(file) ⇒ Boolean
47 48 49 |
# File 'lib/logstash/outputs/qingstor/rotation_policy.rb', line 47 def rotate?(file) file.size >= @file_size end |
#to_s ⇒ Object
53 54 55 |
# File 'lib/logstash/outputs/qingstor/rotation_policy.rb', line 53 def to_s { :policy => name, :file_size => @file_size }.to_s end |