class Montrose::Rule::Total

Public Class Methods

apply_options(opts) click to toggle source
# File lib/montrose/rule/total.rb, line 8
def self.apply_options(opts)
  opts[:total]
end
new(max) click to toggle source
# File lib/montrose/rule/total.rb, line 12
def initialize(max)
  @max = max
  @count = 0
end

Public Instance Methods

advance!(time) click to toggle source
# File lib/montrose/rule/total.rb, line 21
def advance!(time)
  @count += 1
  continue?(time)
end
continue?(_time) click to toggle source
# File lib/montrose/rule/total.rb, line 26
def continue?(_time)
  @count <= @max
end
include?(time) click to toggle source
# File lib/montrose/rule/total.rb, line 17
def include?(time)
  continue?(time)
end