Module: MothBallLib

Defined in:
lib/mothball.rb

Overview

calculate after n day from today (circleciによるtest&deploy)

Class Method Summary collapse

Class Method Details

.next_day(n) ⇒ String

after n day from today

Examples:

MothBallLib::next_day(2) => 2013-10-22

Returns 今日からn日後の値(yyyy-mm-dd).

Parameters:

  • n (int)

    n日後

Returns:

  • (String)

    今日からn日後の値(yyyy-mm-dd)



13
14
15
16
17
# File 'lib/mothball.rb', line 13

def next_day(n)
  today = Date.today
  prev = today.next_day(n)
  return prev.strftime("%Y-%m-%d")
end