Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module TimeDSL
  
  def second
    self * 1
  end
  alias_method :seconds, :second
  
  def minute
    self * 60
  end
  alias_method :minutes, :minute
  
  def hour
    self * 3600
  end
  alias_method :hours, :hour
  
  def day
    self * 86400
  end
  alias_method :days, :day
  
  def week
    self * 604800
  end
  alias_method :weeks, :week
  
  def month
    self * 18144000
  end
  alias_method :months, :month
  
  def year
    self * 31471200
  end
  alias_method :years, :year
  
end
Numeric.send :include, TimeDSL