Sha256: 38f1877e17386eefd39b34cd601c32184d01d75d557b2b7e8fe7f1f7b81af92d

Contents?: true

Size: 452 Bytes

Versions: 2

Compression:

Stored size: 452 Bytes

Contents

module Ballista
  module Frequencies
    ##
    # Weekly actions
    class Weekly < Base
      def log
        pointer = Date.parse(@when)
        get_dates([], pointer)
      end

      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

      def step
        7
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ballista-0.1.0 lib/ballista/frequencies/weekly.rb
ballista-0.0.5 lib/ballista/frequencies/weekly.rb