Class: Txray::Tail
- Inherits:
-
Object
- Object
- Txray::Tail
- Defined in:
- lib/txray/tail.rb
Constant Summary collapse
- INTERVAL =
0.15
Instance Method Summary collapse
- #each_batch ⇒ Object
-
#initialize(path, from_start: false) ⇒ Tail
constructor
A new instance of Tail.
Constructor Details
#initialize(path, from_start: false) ⇒ Tail
Returns a new instance of Tail.
7 8 9 10 |
# File 'lib/txray/tail.rb', line 7 def initialize(path, from_start: false) @path = path @skip_existing = !from_start && File.exist?(path) end |
Instance Method Details
#each_batch ⇒ Object
12 13 14 15 16 17 |
# File 'lib/txray/tail.rb', line 12 def each_batch loop do yield read sleep INTERVAL end end |