Module: DateDiscreter
- Defined in:
- lib/date_discreter.rb,
lib/date_discreter/version.rb
Constant Summary collapse
- VERSION =
"0.0.4"
Class Method Summary collapse
-
.continuous_days?(dates) ⇒ Boolean
whether arg months are continuous.
-
.continuous_hours?(hours) ⇒ Boolean
whether arg months are continuous.
-
.continuous_months?(months) ⇒ Boolean
whether arg months are continuous.
-
.discrete_days(dates) ⇒ Array<Date>
return discrete of arg days.
-
.discrete_hours(hours) ⇒ Array<Time>
return discrete of arg hours.
-
.discrete_months(months) ⇒ Array<Date>
return discrete of arg months.
Class Method Details
.continuous_days?(dates) ⇒ Boolean
whether arg months are continuous
50 51 52 |
# File 'lib/date_discreter.rb', line 50 def continuous_days?(dates) discrete_days(dates).empty? end |
.continuous_hours?(hours) ⇒ Boolean
whether arg months are continuous
56 57 58 |
# File 'lib/date_discreter.rb', line 56 def continuous_hours?(hours) discrete_hours(hours).empty? end |
.continuous_months?(months) ⇒ Boolean
whether arg months are continuous
44 45 46 |
# File 'lib/date_discreter.rb', line 44 def continuous_months?(months) discrete_months(months).empty? end |
.discrete_days(dates) ⇒ Array<Date>
return discrete of arg days
17 18 19 |
# File 'lib/date_discreter.rb', line 17 def discrete_days(dates) discrete_times(dates, 1.day) end |
.discrete_hours(hours) ⇒ Array<Time>
return discrete of arg hours
24 25 26 |
# File 'lib/date_discreter.rb', line 24 def discrete_hours(hours) discrete_times(hours, 1.hour) end |
.discrete_months(months) ⇒ Array<Date>
return discrete of arg months
10 11 12 |
# File 'lib/date_discreter.rb', line 10 def discrete_months(months) discrete_times(months, 1.month) end |