Class: TextToNoise::LogReader
- Inherits:
-
Object
- Object
- TextToNoise::LogReader
- Defined in:
- lib/text_to_noise/log_reader.rb
Instance Attribute Summary collapse
-
#io ⇒ Object
readonly
Returns the value of attribute io.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(io, mapper) ⇒ LogReader
constructor
A new instance of LogReader.
Constructor Details
#initialize(io, mapper) ⇒ LogReader
Returns a new instance of LogReader.
4 5 6 |
# File 'lib/text_to_noise/log_reader.rb', line 4 def initialize( io, mapper ) @io, @mapper = io, mapper end |
Instance Attribute Details
#io ⇒ Object (readonly)
Returns the value of attribute io.
3 4 5 |
# File 'lib/text_to_noise/log_reader.rb', line 3 def io @io end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 |
# File 'lib/text_to_noise/log_reader.rb', line 8 def call() while line = io.gets @mapper.dispatch line TextToNoise.throttle! end end |