Class: Montrose::Rule::NthDayOfYear::YearDay

Inherits:
Object
  • Object
show all
Defined in:
lib/montrose/rule/nth_day_of_year.rb

Instance Method Summary collapse

Constructor Details

#initialize(time) ⇒ YearDay

Returns a new instance of YearDay


38
39
40
# File 'lib/montrose/rule/nth_day_of_year.rb', line 38

def initialize(time)
  @time = time
end

Instance Method Details

#first_wdayObject


46
47
48
# File 'lib/montrose/rule/nth_day_of_year.rb', line 46

def first_wday
  @time.beginning_of_year.wday
end

#nth_dayObject


42
43
44
# File 'lib/montrose/rule/nth_day_of_year.rb', line 42

def nth_day
  @time.yday
end

#total_daysObject


50
51
52
# File 'lib/montrose/rule/nth_day_of_year.rb', line 50

def total_days
  days_in_year(@time)
end