class Montrose::Rule::Until
Public Class Methods
Source
# File lib/montrose/rule/until.rb, line 8 def self.apply_options(opts) return false unless opts[:until] {until: opts[:until], exclude_end: opts.fetch(:exclude_end, false)} end
Source
# File lib/montrose/rule/until.rb, line 14 def initialize(opts) @end_time = opts.fetch(:until) @exclude_end = opts.fetch(:exclude_end) end
Public Instance Methods
Source
# File lib/montrose/rule/until.rb, line 19 def include?(time) if @exclude_end time < @end_time else time <= @end_time end end