Class: Date

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

Class Method Summary collapse

Class Method Details

.today?(date) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/extensions/date.rb', line 3

def today?(date)
  Date.today == date
end

.tomorrow?(date) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/extensions/date.rb', line 11

def tomorrow?(date)
  (Date.today + 1) == date
end

.yesterday?(date) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/extensions/date.rb', line 7

def yesterday?(date)
  (Date.today - 1) == date
end