Class: CronSpec::SingleValueCronValue

Inherits:
CronValueBase show all
Defined in:
lib/cron-spec/single_value_cron_value.rb

Instance Attribute Summary collapse

Attributes inherited from CronValueBase

#lower_limit, #upper_limit

Instance Method Summary collapse

Methods inherited from CronValueBase

#is_value_within_limits?

Constructor Details

#initialize(lower_limit, upper_limit, single_value) ⇒ SingleValueCronValue

Returns a new instance of SingleValueCronValue.



7
8
9
10
11
12
13
# File 'lib/cron-spec/single_value_cron_value.rb', line 7

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_valueObject (readonly)

Returns the value of attribute single_value.



5
6
7
# File 'lib/cron-spec/single_value_cron_value.rb', line 5

def single_value
  @single_value
end

Instance Method Details

#is_effective?(value) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/cron-spec/single_value_cron_value.rb', line 15

def is_effective?(value)
  @single_value == value
end