Sha256: 75bae2fbefeca081a1225c03f755b8f66aeeefa63a2e9b0d56aa0c20e1393fa1

Contents?: true

Size: 499 Bytes

Versions: 1

Compression:

Stored size: 499 Bytes

Contents

module Workarea
  class Segment
    module Rules
      class TrafficReferrer < Base
        field :medium, type: String
        field :source, type: String

        def qualifies?(visit)
          return false if medium.blank? && source.blank?
          return false unless visit.referrer[:known]

          (medium.blank? || medium.strip.casecmp?(visit.referrer[:medium])) &&
            (source.blank? || visit.referrer[:source].to_s =~ /#{source.strip}/i)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
workarea-core-3.5.0.beta.1 app/models/workarea/segment/rules/traffic_referrer.rb