Class: Ballista::Frequencies::Weekly

Inherits:
Base
  • Object
show all
Defined in:
lib/ballista/frequencies/weekly.rb

Overview

Weekly actions

Direct Known Subclasses

Biweekly

Instance Method Summary collapse

Methods inherited from Base

#entry, #initialize

Constructor Details

This class inherits a constructor from Ballista::Frequencies::Base

Instance Method Details

#get_dates(log, pointer) ⇒ Object



11
12
13
14
15
16
# File 'lib/ballista/frequencies/weekly.rb', line 11

def get_dates(log, pointer)
  return log if pointer > @stop
  return get_dates(log, pointer + step) if pointer < @start
  log << entry(pointer)
  get_dates(log, pointer + step)
end

#logObject



6
7
8
9
# File 'lib/ballista/frequencies/weekly.rb', line 6

def log
  pointer = Date.parse(@when)
  get_dates([], pointer)
end

#stepObject



18
19
20
# File 'lib/ballista/frequencies/weekly.rb', line 18

def step
  7
end