class HTTPLogAnalyzer::Element

Public Class Methods

parse(string) click to toggle source
# File lib/http-log-analyzer/element.rb, line 5
def self.parse(string)
  $cache ||= {}
  $cache[self] ||= {}
  $cache[self][string] ||= new.tap { |e| e.parse(string) }
end

Public Instance Methods

normalize_uri!(uri) click to toggle source
# File lib/http-log-analyzer/element.rb, line 11
def normalize_uri!(uri)
  uri.normalize!
  uri.scheme = 'http' if uri.scheme == 'https'
  uri.host = uri.host.downcase.sub(/^(www|m)\./, '').sub(/\.$/, '') if uri.host
end