Module: Weekends::OnDate

Included in:
Weekend
Defined in:
lib/weekends/on_date.rb

Instance Method Summary collapse

Instance Method Details

#on_date?(date) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
# File 'lib/weekends/on_date.rb', line 3

def on_date?(date)
  date = time_coerced(date)
  date.wday.zero? || date.wday == 6
end

#today?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/weekends/on_date.rb', line 8

def today?
  on_date?(Time.now)
end