class DateTimeStepWith::CronRangeMatcher

Copied from en.wikipedia.org/wiki/Cron

│ │ │ │ │ │ │ │ │ │ │ │ │ │ └───── day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0) │ │ │ └────────── month (1 - 12) │ │ └─────────────── day of month (1 - 31) │ └──────────────────── hour (0 - 23) └───────────────────────── min (0 - 59)

Public Class Methods

new(cron_expression) click to toggle source
# File lib/date_time_step_with/cron_matcher.rb, line 13
def initialize(cron_expression)
  from, to = cron_expression.split("-")
  @range = (from..to).to_a
end

Public Instance Methods

=~(value) click to toggle source
# File lib/date_time_step_with/cron_matcher.rb, line 18
def =~(value)
  @range.include? value
end