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
79 80 81 |
# File 'lib/eye/utils/mini_active_support.rb', line 79 def ago ::Time.now - self end |
#bytes ⇒ Object Also known as: byte
83 84 85 |
# File 'lib/eye/utils/mini_active_support.rb', line 83 def bytes self end |
#days ⇒ Object Also known as: day
69 70 71 |
# File 'lib/eye/utils/mini_active_support.rb', line 69 def days self * 86_400 end |
#gigabytes ⇒ Object Also known as: gigabyte
98 99 100 |
# File 'lib/eye/utils/mini_active_support.rb', line 98 def gigabytes self * 1024 * 1024 * 1024 end |
#hours ⇒ Object Also known as: hour
64 65 66 |
# File 'lib/eye/utils/mini_active_support.rb', line 64 def hours self * 3600 end |
#kilobytes ⇒ Object Also known as: kilobyte
88 89 90 |
# File 'lib/eye/utils/mini_active_support.rb', line 88 def kilobytes self * 1024 end |
#megabytes ⇒ Object Also known as: megabyte
93 94 95 |
# File 'lib/eye/utils/mini_active_support.rb', line 93 def megabytes self * 1024 * 1024 end |
#minutes ⇒ Object Also known as: minute
59 60 61 |
# File 'lib/eye/utils/mini_active_support.rb', line 59 def minutes self * 60 end |
#percents ⇒ Object Also known as: percent
49 50 51 |
# File 'lib/eye/utils/mini_active_support.rb', line 49 def percents self end |
#seconds ⇒ Object Also known as: second
54 55 56 |
# File 'lib/eye/utils/mini_active_support.rb', line 54 def seconds self end |
#terabytes ⇒ Object Also known as: terabyte
103 104 105 |
# File 'lib/eye/utils/mini_active_support.rb', line 103 def terabytes self * 1024 * 1024 * 1024 * 1024 end |
#weeks ⇒ Object Also known as: week
74 75 76 |
# File 'lib/eye/utils/mini_active_support.rb', line 74 def weeks self * 86_400 * 7 end |