Class: Date

Inherits:
Object
  • Object
show all
Defined in:
lib/nth_day.rb

Instance Method Summary collapse

Instance Method Details

#nth_of_wdayObject



21
22
23
# File 'lib/nth_day.rb', line 21

def nth_of_wday
  (self.mday.to_f / 7).ceil
end

#nth_wday?(n, w) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/nth_day.rb', line 17

def nth_wday?(n, w)
  (self.wday == w) && (self.nth_of_wday == n)
end