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).
27 28 29 |
# File 'lib/god/sugar.rb', line 27 def days self * 86400 end |
#gigabytes ⇒ Object Also known as: gigabyte
Units of gigabytes (1,048,576 kilobytes).
51 52 53 |
# File 'lib/god/sugar.rb', line 51 def gigabytes self * (1024 ** 2) end |
#hours ⇒ Object Also known as: hour
Public: Units of hours (3600 seconds).
19 20 21 |
# File 'lib/god/sugar.rb', line 19 def hours self * 3600 end |
#kilobytes ⇒ Object Also known as: kilobyte
Units of kilobytes.
35 36 37 |
# File 'lib/god/sugar.rb', line 35 def kilobytes self end |
#megabytes ⇒ Object Also known as: megabyte
Units of megabytes (1024 kilobytes).
43 44 45 |
# File 'lib/god/sugar.rb', line 43 def megabytes self * 1024 end |
#minutes ⇒ Object Also known as: minute
Public: Units of minutes (60 seconds).
11 12 13 |
# File 'lib/god/sugar.rb', line 11 def minutes self * 60 end |
#percent ⇒ Object
Units of percent. e.g. 50.percent.
59 60 61 |
# File 'lib/god/sugar.rb', line 59 def percent self end |
#seconds ⇒ Object Also known as: second
Public: Units of seconds.
3 4 5 |
# File 'lib/god/sugar.rb', line 3 def seconds self end |