Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/god/sugar.rb
Instance Method Summary collapse
-
#days ⇒ Object
(also: #day)
Public: Units of days (86400 seconds).
-
#gigabytes ⇒ Object
(also: #gigabyte)
Units of gigabytes (1,048,576 kilobytes).
-
#hours ⇒ Object
(also: #hour)
Public: Units of hours (3600 seconds).
-
#kilobytes ⇒ Object
(also: #kilobyte)
Units of kilobytes.
-
#megabytes ⇒ Object
(also: #megabyte)
Units of megabytes (1024 kilobytes).
-
#minutes ⇒ Object
(also: #minute)
Public: Units of minutes (60 seconds).
-
#percent ⇒ Object
Units of percent.
-
#seconds ⇒ Object
(also: #second)
Public: Units of seconds.
Instance Method Details
#days ⇒ Object Also known as: day
Public: Units of days (86400 seconds).
29 30 31 |
# File 'lib/god/sugar.rb', line 29 def days self * 86400 end |
#gigabytes ⇒ Object Also known as: gigabyte
Units of gigabytes (1,048,576 kilobytes).
53 54 55 |
# File 'lib/god/sugar.rb', line 53 def gigabytes self * (1024**2) end |
#hours ⇒ Object Also known as: hour
Public: Units of hours (3600 seconds).
21 22 23 |
# File 'lib/god/sugar.rb', line 21 def hours self * 3600 end |
#kilobytes ⇒ Object Also known as: kilobyte
Units of kilobytes.
37 38 39 |
# File 'lib/god/sugar.rb', line 37 def kilobytes self end |
#megabytes ⇒ Object Also known as: megabyte
Units of megabytes (1024 kilobytes).
45 46 47 |
# File 'lib/god/sugar.rb', line 45 def megabytes self * 1024 end |
#minutes ⇒ Object Also known as: minute
Public: Units of minutes (60 seconds).
13 14 15 |
# File 'lib/god/sugar.rb', line 13 def minutes self * 60 end |
#percent ⇒ Object
Units of percent. e.g. 50.percent.
61 62 63 |
# File 'lib/god/sugar.rb', line 61 def percent self end |
#seconds ⇒ Object Also known as: second
Public: Units of seconds.
5 6 7 |
# File 'lib/god/sugar.rb', line 5 def seconds self end |