Class: DurationRange::Date
- Inherits:
-
Object
- Object
- DurationRange::Date
show all
- Includes:
- CommonFunctions
- Defined in:
- lib/duration_range/date.rb
Instance Attribute Summary
#today
Instance Method Summary
collapse
#initialize, #modes, #month_as_date, #months_as_date, #this_month_as_date, #tidy_with_date
Instance Method Details
#last_month(as: :array, count: 1) ⇒ Object
54
55
56
|
# File 'lib/duration_range/date.rb', line 54
def last_month(as: :array, count: 1)
super(as: as, count: count)
end
|
#last_week(as: :array, count: 1) ⇒ Object
81
82
83
|
# File 'lib/duration_range/date.rb', line 81
def last_week(as: :array, count: 1)
super(as: as, count: count)
end
|
#month(month, as: :array) ⇒ Object
generate specific month duration (e.g. 2021-04)
16
17
18
|
# File 'lib/duration_range/date.rb', line 16
def month(month, as: :array)
month_as_date(month, as: as)
end
|
#months(*months, as: :array) ⇒ Object
longest duration from multiple months
27
28
29
|
# File 'lib/duration_range/date.rb', line 27
def months(*months, as: :array)
months_as_date(*months, as: as)
end
|
#next_month(as: :array, count: 1) ⇒ Object
45
46
47
|
# File 'lib/duration_range/date.rb', line 45
def next_month(as: :array, count: 1)
super(as: as, count: count)
end
|
#next_week(as: :array, count: 1) ⇒ Object
72
73
74
|
# File 'lib/duration_range/date.rb', line 72
def next_week(as: :array, count: 1)
super(as: as, count: count)
end
|
#this_month(as: :array, reference_date: today) ⇒ Object
36
37
38
|
# File 'lib/duration_range/date.rb', line 36
def this_month(as: :array, reference_date: today)
this_month_as_date(as: as, reference_date: reference_date)
end
|
#this_week(as: :array, reference_date: today) ⇒ Object
63
64
65
|
# File 'lib/duration_range/date.rb', line 63
def this_week(as: :array, reference_date: today)
super(as: as, reference_date: reference_date)
end
|