Module: TimeCrisis::Support::Advance::Date

Defined in:
lib/time_crisis/support/advance.rb

Instance Method Summary collapse

Instance Method Details

#advance(options) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/time_crisis/support/advance.rb', line 3

def advance(options)
  options = options.dup
  d = self
  d = d >> options.delete(:years) * 12 if options[:years]
  d = d >> options.delete(:months)     if options[:months]
  d = d +  options.delete(:weeks) * 7  if options[:weeks]
  d = d +  options.delete(:days)       if options[:days]
  d
end