Class: Scheduling::RegularSchedule

Inherits:
Struct
  • Object
show all
Defined in:
lib/scheduling/schedule/regular_schedule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#date_rangeObject

Returns the value of attribute date_range

Returns:

  • (Object)

    the current value of date_range



2
3
4
# File 'lib/scheduling/schedule/regular_schedule.rb', line 2

def date_range
  @date_range
end

#regularityObject

Returns the value of attribute regularity

Returns:

  • (Object)

    the current value of regularity



2
3
4
# File 'lib/scheduling/schedule/regular_schedule.rb', line 2

def regularity
  @regularity
end

Instance Method Details

#occurances(date_range) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/scheduling/schedule/regular_schedule.rb', line 3

def occurances date_range
  occurances = []
  overlap = self.date_range & date_range
  unless overlap.nil?
    occurances = regularity.occurances(overlap)
  end
  return occurances
end