Sha256: ac2faff430b2b9609a040d16535bafccf4b0821e1d9c35ff37c8f4f4b96a3e2f

Contents?: true

Size: 419 Bytes

Versions: 12

Compression:

Stored size: 419 Bytes

Contents

module Montrose
  module Rule
    class Total
      include Montrose::Rule

      def self.apply_options(opts)
        opts[:total]
      end

      def initialize(max)
        @max = max
        @count = 0
      end

      def include?(_time)
        continue?
      end

      def advance!(_time)
        @count += 1
        continue?
      end

      def continue?
        @count <= @max
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
montrose-0.6.0 lib/montrose/rule/total.rb
montrose-0.5.0 lib/montrose/rule/total.rb
montrose-0.4.3 lib/montrose/rule/total.rb
montrose-0.4.2 lib/montrose/rule/total.rb
montrose-0.4.1 lib/montrose/rule/total.rb
montrose-0.4.0 lib/montrose/rule/total.rb
montrose-0.3.0 lib/montrose/rule/total.rb
montrose-0.2.2 lib/montrose/rule/total.rb
montrose-0.2.1 lib/montrose/rule/total.rb
montrose-0.2.0 lib/montrose/rule/total.rb
montrose-0.1.1 lib/montrose/rule/total.rb
montrose-0.1.0 lib/montrose/rule/total.rb