Method: Date#add_chunk

Defined in:
lib/fat_core/date.rb

#add_chunk(chunk) ⇒ Object



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/fat_core/date.rb', line 363

def add_chunk(chunk)
  case chunk
  when :year
    next_year
  when :quarter
    next_month(3)
  when :bimonth
    next_month(2)
  when :month
    next_month
  when :semimonth
    self + 15.days
  when :biweek
    self + 14.days
  when :week
    self + 7.days
  when :day
    self + 1.days
  else
    raise ArgumentError, "add_chunk unknown chunk: '#{chunk}'"
  end
end