Modify the Time class to provide methods for converting a given number of date units (like years, weeks, and days) to seconds.
Methods
Public Class methods
[ show source ]
# File lib/datename.rb, line 31
31: def Time.days( num )
32: num * Time.hours( 24 )
33: end
[ show source ]
# File lib/datename.rb, line 35
35: def Time.hours( num )
36: num * Time.minutes( 60 )
37: end
[ show source ]
# File lib/datename.rb, line 39
39: def Time.minutes( num )
40: num * Time.seconds( 60 )
41: end
[ show source ]
# File lib/datename.rb, line 43
43: def Time.seconds( num )
44: num
45: end
[ show source ]
# File lib/datename.rb, line 27
27: def Time.weeks( num )
28: num * Time.days( 7 )
29: end
[ show source ]
# File lib/datename.rb, line 23
23: def Time.years( num )
24: num * Time.days( 365 )
25: end