Class: Browserlog::LogReader
- Inherits:
-
Object
- Object
- Browserlog::LogReader
- Defined in:
- lib/browserlog/log_reader.rb
Instance Method Summary collapse
Instance Method Details
#read(options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/browserlog/log_reader.rb', line 3 def read( = {}) offset = [:offset] || -1 limit = [:limit] || 25 amount = [limit, remaining_lines(offset)].min if offset == -1 line_index = num_lines [readlines(amount), line_index] else line_index = offset + amount [readlines(amount), line_index] end end |