Class: Logripper::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/logripper/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log_file) ⇒ Parser

Returns a new instance of Parser.



5
6
7
# File 'lib/logripper/parser.rb', line 5

def initialize(log_file)
  @log_file = log_file
end

Instance Attribute Details

#log_fileObject (readonly)

Returns the value of attribute log_file.



3
4
5
# File 'lib/logripper/parser.rb', line 3

def log_file
  @log_file
end

Instance Method Details

#find(url) ⇒ Object



9
10
11
12
13
# File 'lib/logripper/parser.rb', line 9

def find(url)
  parsed_lines.find_all do |line|
    line[:url] == url
  end.force
end