module WeekendCheck
rubocop:disable Style/Documentation
Public Instance Methods
next_weekend()
click to toggle source
# File lib/wheres_my_weekend.rb, line 12 def next_weekend [next_saturday, next_saturday.add_days(1)] end
weekend?()
click to toggle source
# File lib/wheres_my_weekend.rb, line 8 def weekend? saturday? || sunday? end
Protected Instance Methods
last_saturday()
click to toggle source
# File lib/wheres_my_weekend.rb, line 18 def last_saturday saturday? ? sub_days(7) : sub_days(wday + 1) end
next_saturday()
click to toggle source
# File lib/wheres_my_weekend.rb, line 22 def next_saturday saturday? ? add_days(7) : add_days(6 - wday) end