Class: When::CronRange

Inherits:
Object
  • Object
show all
Defined in:
lib/when-cron/cron/cron_range.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(first, last) ⇒ CronRange

Returns a new instance of CronRange.



5
6
7
8
# File 'lib/when-cron/cron/cron_range.rb', line 5

def initialize(first, last)
  @first = first
  @last = last
end

Instance Attribute Details

#firstObject (readonly)

Returns the value of attribute first.



3
4
5
# File 'lib/when-cron/cron/cron_range.rb', line 3

def first
  @first
end

#lastObject (readonly)

Returns the value of attribute last.



3
4
5
# File 'lib/when-cron/cron/cron_range.rb', line 3

def last
  @last
end

Instance Method Details

#==(int) ⇒ Object



10
11
12
# File 'lib/when-cron/cron/cron_range.rb', line 10

def ==(int)
  @first <= int && @last >= int
end