Class: PositionFile
- Inherits:
-
Object
- Object
- PositionFile
- Defined in:
- lib/fluent/plugin/position_file.rb
Instance Method Summary collapse
-
#initialize(pos_file_path) ⇒ PositionFile
constructor
A new instance of PositionFile.
- #processed?(violation) ⇒ Boolean
- #write(violation) ⇒ Object
Constructor Details
#initialize(pos_file_path) ⇒ PositionFile
Returns a new instance of PositionFile.
3 4 5 |
# File 'lib/fluent/plugin/position_file.rb', line 3 def initialize(pos_file_path) @pos_file_path = pos_file_path end |
Instance Method Details
#processed?(violation) ⇒ Boolean
7 8 9 |
# File 'lib/fluent/plugin/position_file.rb', line 7 def processed?(violation) File.exist?(pos_file_name(violation)) && found?(violation) end |
#write(violation) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/fluent/plugin/position_file.rb', line 11 def write(violation) File.open(pos_file_name(violation), 'a') do |f| f << violation_entry(violation) f << "\n" end end |