Class: Date
- Inherits:
-
Object
- Object
- Date
- Defined in:
- lib/certificate_authority/core_extensions.rb
Instance Method Summary collapse
Instance Method Details
#advance(options) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/certificate_authority/core_extensions.rb', line 36 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 |
#today ⇒ Object
26 27 28 29 |
# File 'lib/certificate_authority/core_extensions.rb', line 26 def today t = Time.now.utc Date.new(t.year, t.month, t.day) end |
#utc ⇒ Object
31 32 33 |
# File 'lib/certificate_authority/core_extensions.rb', line 31 def utc self.to_datetime.to_time.utc end |