module Alparser::Keyed::InstanceMethods

Public Instance Methods

f_id(sep="-") click to toggle source

Key is build from domain, date, class and id if foreign key if present

# File lib/alparser/climb.rb, line 6
def f_id sep="-"
  [domain, self.date.to_s, self.class.to_s.split("::").last, self.id]
    .compact
    .join("|")
    .downcase
    .gsub!(/[^a-z0-9\-_]+/, sep)
end

Private Instance Methods

domain() click to toggle source
# File lib/alparser/climb.rb, line 16
def domain
  host = URI.parse(self.base_uri).host.downcase
  host.start_with?('www.') ? host[4..-1] : host
end