class CronSpec::SingleValueCronValue
A single cron value
Attributes
single_value[R]
Public Class Methods
new(lower_limit, upper_limit, single_value)
click to toggle source
Constructs a new SingleValueCronValue
having the specified limits and value. The value is checked to determine if it fits within the specified limits; if it doesn’t, an exception is raised.
Calls superclass method
CronSpec::CronValueBase::new
# File lib/cron-spec/single_value_cron_value.rb, line 15 def initialize(lower_limit, upper_limit, single_value) super(lower_limit, upper_limit) @single_value = single_value raise "Value is out of range: #{@single_value}" unless is_value_within_limits?(@single_value) end
Public Instance Methods
is_effective?(value)
click to toggle source
Returns true if the specified value is equal to the value encapsulated by the SingleValueCronValue
.
# File lib/cron-spec/single_value_cron_value.rb, line 27 def is_effective?(value) @single_value == value end