Class: Scheduling::IrregularSchedule

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#datesObject

Returns the value of attribute dates

Returns:

  • (Object)

    the current value of dates



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

def dates
  @dates
end

Instance Method Details

#occurances(date_range) ⇒ Object



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

def occurances date_range
  occurances = []
  dates.each do |date|
    if date_range.include? date
      occurances.push date
    end
  end
  return occurances.uniq.sort
end