Class: Numeric
Instance Method Summary collapse
- #ago ⇒ Object
- #bytes ⇒ Object (also: #byte)
- #days ⇒ Object (also: #day)
- #gigabytes ⇒ Object (also: #gigabyte)
- #hours ⇒ Object (also: #hour)
- #kilobytes ⇒ Object (also: #kilobyte)
- #megabytes ⇒ Object (also: #megabyte)
- #minutes ⇒ Object (also: #minute)
- #percents ⇒ Object (also: #percent)
- #seconds ⇒ Object (also: #second)
- #terabytes ⇒ Object (also: #terabyte)
- #weeks ⇒ Object (also: #week)
Instance Method Details
#ago ⇒ Object
83 84 85 |
# File 'lib/eye/utils/mini_active_support.rb', line 83 def ago ::Time.now - self end |
#bytes ⇒ Object Also known as: byte
87 88 89 |
# File 'lib/eye/utils/mini_active_support.rb', line 87 def bytes self end |
#days ⇒ Object Also known as: day
73 74 75 |
# File 'lib/eye/utils/mini_active_support.rb', line 73 def days self * 86400 end |
#gigabytes ⇒ Object Also known as: gigabyte
102 103 104 |
# File 'lib/eye/utils/mini_active_support.rb', line 102 def gigabytes self * 1024 * 1024 * 1024 end |
#hours ⇒ Object Also known as: hour
68 69 70 |
# File 'lib/eye/utils/mini_active_support.rb', line 68 def hours self * 3600 end |
#kilobytes ⇒ Object Also known as: kilobyte
92 93 94 |
# File 'lib/eye/utils/mini_active_support.rb', line 92 def kilobytes self * 1024 end |
#megabytes ⇒ Object Also known as: megabyte
97 98 99 |
# File 'lib/eye/utils/mini_active_support.rb', line 97 def megabytes self * 1024 * 1024 end |
#minutes ⇒ Object Also known as: minute
63 64 65 |
# File 'lib/eye/utils/mini_active_support.rb', line 63 def minutes self * 60 end |
#percents ⇒ Object Also known as: percent
53 54 55 |
# File 'lib/eye/utils/mini_active_support.rb', line 53 def percents self end |
#seconds ⇒ Object Also known as: second
58 59 60 |
# File 'lib/eye/utils/mini_active_support.rb', line 58 def seconds self end |
#terabytes ⇒ Object Also known as: terabyte
107 108 109 |
# File 'lib/eye/utils/mini_active_support.rb', line 107 def terabytes self * 1024 * 1024 * 1024 * 1024 end |
#weeks ⇒ Object Also known as: week
78 79 80 |
# File 'lib/eye/utils/mini_active_support.rb', line 78 def weeks self * 86400 * 7 end |