repo.or.cz
/
amazing.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Some missing license statements
[amazing.git]
/
lib
/
amazing
/
numeric.rb
blob
ef24f52a0d97d4674722f33c61127f66418b949a
1
# Copyright (C) 2008 Dag Odenhall <dag.odenhall@gmail.com>
2
# Licensed under the Academic Free License version 3.0
3
4
class Numeric
5
def seconds
6
self
7
end
8
alias :second :seconds
9
10
def minutes
11
self * 60
12
end
13
alias :minute :minutes
14
15
def hours
16
minutes * 60
17
end
18
alias :hour :hours
19
20
def days
21
hours * 24
22
end
23
alias :day :days
24
25
def weeks
26
days * 7
27
end
28
alias :week :weeks
29
30
def months
31
weeks * 4
32
end
33
alias :month :months
34
35
def years
36
months * 12
37
end
38
alias :year :years
39
end