class Pipely::PipelineDateTime::PipelineMonthRange

Class that represents a range of individual pipeline months

Constants

MINIMUM_MONTH_OFFSET
MONTH_INTERVAL

Attributes

end[R]
start[R]

Public Class Methods

new(target_date, days_back_start, days_back_end) click to toggle source
# File lib/pipely/pipeline_date_time/pipeline_month_range.rb, line 14
def initialize(target_date, days_back_start, days_back_end)
  @target_date = target_date
  @start = days_back_start - MINIMUM_MONTH_OFFSET
  @end = days_back_end + MINIMUM_MONTH_OFFSET
  @days_back = (@end..@start).step(MONTH_INTERVAL).to_set
end

Public Instance Methods

months() click to toggle source
# File lib/pipely/pipeline_date_time/pipeline_month_range.rb, line 21
def months
  @months ||= pipeline_dates.map { |pd| pd.month }
end