Class: Montrose::Rule::NthDayOfMonth::MonthDay
- Inherits:
-
Object
- Object
- Montrose::Rule::NthDayOfMonth::MonthDay
- Defined in:
- lib/montrose/rule/nth_day_of_month.rb
Instance Method Summary collapse
- #first_wday ⇒ Object
-
#initialize(time) ⇒ MonthDay
constructor
A new instance of MonthDay.
- #nth_day ⇒ Object
- #total_days ⇒ Object
Constructor Details
#initialize(time) ⇒ MonthDay
Returns a new instance of MonthDay.
37 38 39 |
# File 'lib/montrose/rule/nth_day_of_month.rb', line 37 def initialize(time) @time = time end |
Instance Method Details
#first_wday ⇒ Object
45 46 47 |
# File 'lib/montrose/rule/nth_day_of_month.rb', line 45 def first_wday @time.beginning_of_month.wday end |
#nth_day ⇒ Object
41 42 43 |
# File 'lib/montrose/rule/nth_day_of_month.rb', line 41 def nth_day @time.mday end |
#total_days ⇒ Object
49 50 51 |
# File 'lib/montrose/rule/nth_day_of_month.rb', line 49 def total_days ::Montrose::Utils.days_in_month(@time.month, @time.year) end |