Sha256: d8484d6031b07e0541b9a4447e238e851b96565c89485a116b4f7de23fca1d81

Contents?: true

Size: 401 Bytes

Versions: 28

Compression:

Stored size: 401 Bytes

Contents

module Workarea
  class Segment
    module Rules
      class Sessions < Base
        field :minimum, type: Integer
        field :maximum, type: Integer

        def qualifies?(visit)
          return false if minimum.blank? && maximum.blank?

          (minimum.blank? || visit.sessions >= minimum) &&
            (maximum.blank? || visit.sessions <= maximum)
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-core-3.5.6 app/models/workarea/segment/rules/sessions.rb
workarea-core-3.5.5 app/models/workarea/segment/rules/sessions.rb
workarea-core-3.5.4 app/models/workarea/segment/rules/sessions.rb
workarea-core-3.5.3 app/models/workarea/segment/rules/sessions.rb
workarea-core-3.5.2 app/models/workarea/segment/rules/sessions.rb
workarea-core-3.5.1 app/models/workarea/segment/rules/sessions.rb
workarea-core-3.5.0 app/models/workarea/segment/rules/sessions.rb
workarea-core-3.5.0.beta.1 app/models/workarea/segment/rules/sessions.rb