Class: CronSpec::SingleValueCronValue
- Inherits:
-
CronValueBase
- Object
- CronValueBase
- CronSpec::SingleValueCronValue
- Defined in:
- lib/cron-spec/single_value_cron_value.rb
Overview
A single cron value
Instance Attribute Summary collapse
-
#single_value ⇒ Object
readonly
Returns the value of attribute single_value.
Attributes inherited from CronValueBase
Instance Method Summary collapse
-
#initialize(lower_limit, upper_limit, single_value) ⇒ SingleValueCronValue
constructor
Constructs a new SingleValueCronValue having the specified limits and value.
-
#is_effective?(value) ⇒ Boolean
Returns true if the specified value is equal to the value encapsulated by the SingleValueCronValue.
Methods inherited from CronValueBase
Constructor Details
#initialize(lower_limit, upper_limit, single_value) ⇒ SingleValueCronValue
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.
15 16 17 18 19 20 21 |
# 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 |
Instance Attribute Details
#single_value ⇒ Object (readonly)
Returns the value of attribute single_value.
8 9 10 |
# File 'lib/cron-spec/single_value_cron_value.rb', line 8 def single_value @single_value end |
Instance Method Details
#is_effective?(value) ⇒ Boolean
Returns true if the specified value is equal to the value encapsulated by the SingleValueCronValue.
27 28 29 |
# File 'lib/cron-spec/single_value_cron_value.rb', line 27 def is_effective?(value) @single_value == value end |