Class: Date
Instance Method Summary collapse
Instance Method Details
#days_in_month ⇒ Object
30 31 32 |
# File 'lib/commercebank.rb', line 30 def days_in_month (Date.parse("12/31/#{strftime("%Y")}") << (12 - month)).day end |
#last_sunday ⇒ Object
34 35 36 37 38 |
# File 'lib/commercebank.rb', line 34 def last_sunday d = self d -= 1 until d.wday == 0 d end |