Module: TimeExt

Included in:
Time
Defined in:
lib/datatransit/helper.rb

Overview

To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor.

Instance Method Summary collapse

Instance Method Details

#fly_by_day(days) ⇒ Object



6
7
8
# File 'lib/datatransit/helper.rb', line 6

def fly_by_day days
  Time.at(self.to_i + days * 24 * 60 * 60)
end

#fly_by_month(months) ⇒ Object



14
15
16
# File 'lib/datatransit/helper.rb', line 14

def fly_by_month months
  Time.at(self.to_i + months * 30 * 24 * 60 * 60)
end

#fly_by_week(weeks) ⇒ Object



10
11
12
# File 'lib/datatransit/helper.rb', line 10

def fly_by_week weeks
  Time.at(self.to_i + weeks * 7 * 24 * 60 * 60)
end

#midnightObject



18
19
20
# File 'lib/datatransit/helper.rb', line 18

def midnight
  Time.at(self.year, self.month, self.day, 24, 0, 0 )
end