Class: Date

Inherits:
Object show all
Defined in:
lib/redmilk/monkey.rb

Instance Method Summary collapse

Instance Method Details

#days_in_monthObject



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

def days_in_month
  (Date.parse("12/31/#{strftime("%Y")}") << (12 - month)).day
end

#last_sundayObject



28
29
30
31
32
# File 'lib/redmilk/monkey.rb', line 28

def last_sunday
  d = self
  d -= 1 until d.wday == 0
  d
end

#tomorrowObject



25
# File 'lib/redmilk/monkey.rb', line 25

def tomorrow; self + 1; end

#yesterdayObject



26
# File 'lib/redmilk/monkey.rb', line 26

def yesterday; self - 1; end