Class: Date
- Inherits:
-
Object
- Object
- Date
- Defined in:
- lib/hosemonkey/ext/date.rb
Instance Method Summary collapse
-
#advance(options) ⇒ Object
From active support.
-
#change(options) ⇒ Object
From active support.
Instance Method Details
#advance(options) ⇒ Object
From active support
3 4 5 6 7 8 9 10 11 |
# File 'lib/hosemonkey/ext/date.rb', line 3 def advance() = .dup d = self d = d >> .delete(:years) * 12 if [:years] d = d >> .delete(:months) if [:months] d = d + .delete(:weeks) * 7 if [:weeks] d = d + .delete(:days) if [:days] d end |
#change(options) ⇒ Object
From active support
14 15 16 17 18 19 20 |
# File 'lib/hosemonkey/ext/date.rb', line 14 def change() ::Date.new( [:year] || self.year, [:month] || self.month, [:day] || self.day ) end |