Sha256: 4c46d40ad748c2bd492b4a046379a2097e2da5559b5bd0319f03f0ded63b2521
Contents?: true
Size: 602 Bytes
Versions: 4
Compression:
Stored size: 602 Bytes
Contents
module Ahoy module Deckhands class TrafficSourceDeckhand def initialize(referrer) @referrer = referrer end def referring_domain @referring_domain ||= Addressable::URI.parse(@referrer).host.first(255) rescue nil end def search_keyword @search_keyword ||= (self.class.referrer_parser.parse(@referrer)[1].first(255) rescue nil).presence end # performance hack for referer-parser def self.referrer_parser @referrer_parser ||= RefererParser::Referer.new("https://github.com/ankane/ahoy") end end end end
Version data entries
4 entries across 4 versions & 1 rubygems