Class: ScribeIt::Source::Reader
- Inherits:
-
EventMachine::FileTail
- Object
- EventMachine::FileTail
- ScribeIt::Source::Reader
- Defined in:
- lib/scribeit/source.rb
Instance Method Summary collapse
-
#initialize(path, receiver) ⇒ Reader
constructor
A new instance of Reader.
- #receive_data(data) ⇒ Object
Constructor Details
#initialize(path, receiver) ⇒ Reader
Returns a new instance of Reader.
23 24 25 26 27 |
# File 'lib/scribeit/source.rb', line 23 def initialize(path, receiver) super path @receiver = receiver @buffer = BufferedTokenizer.new end |
Instance Method Details
#receive_data(data) ⇒ Object
29 30 31 32 33 |
# File 'lib/scribeit/source.rb', line 29 def receive_data(data) @buffer.extract(data).each do |line| @receiver.receive(self, line) end end |