module Pipely::PipelineDateTime::PipelineDatePattern
Mixin for constructing compact date pattern selections
Public Instance Methods
date_pattern()
click to toggle source
# File lib/pipely/pipeline_date_time/pipeline_date_pattern.rb, line 11 def date_pattern selection.target_all_time ? '.*' : any_string(date_pattern_parts) end
Private Instance Methods
date_pattern_parts()
click to toggle source
# File lib/pipely/pipeline_date_time/pipeline_date_pattern.rb, line 17 def date_pattern_parts day_range.exclude(month_range.start, month_range.end) month_range.exclude(year_range.start, year_range.end) day_range.days + month_range.months + year_range.years end
day_range()
click to toggle source
# File lib/pipely/pipeline_date_time/pipeline_date_pattern.rb, line 23 def day_range @day_range ||= PipelineDayRange.new(selection.target_date, num_days, 0) end
month_range()
click to toggle source
# File lib/pipely/pipeline_date_time/pipeline_date_pattern.rb, line 27 def month_range @month_range ||= PipelineMonthRange.new(selection.target_date, num_days, 0) end
num_days()
click to toggle source
# File lib/pipely/pipeline_date_time/pipeline_date_pattern.rb, line 37 def num_days selection.num_days_back.to_i end
year_range()
click to toggle source
# File lib/pipely/pipeline_date_time/pipeline_date_pattern.rb, line 32 def year_range @year_range ||= PipelineYearRange.new(selection.target_date, num_days, 0) end