Class: Log::Analyzer::Analyze

Inherits:
Object
  • Object
show all
Defined in:
lib/log-analyzer/analyze.rb

Instance Method Summary collapse

Constructor Details

#initialize(files, routes_text) ⇒ Analyze

Returns a new instance of Analyze.



3
4
5
6
7
# File 'lib/log-analyzer/analyze.rb', line 3

def initialize(files, routes_text)
  @files = Dir.glob(files).select { |f| File.file?(f) }
  @routes = Routes.new(routes_text)
  create_endpoints
end

Instance Method Details

#resultObject



9
10
11
# File 'lib/log-analyzer/analyze.rb', line 9

def result
  @result ||= matche
end

#sortObject



13
14
15
# File 'lib/log-analyzer/analyze.rb', line 13

def sort
  result.sort{ |a, b| b.count <=> a.count }
end