Class: Numeric

Inherits:
Object show all
Defined in:
lib/eye/utils/mini_active_support.rb

Instance Method Summary collapse

Instance Method Details

#agoObject



78
79
80
# File 'lib/eye/utils/mini_active_support.rb', line 78

def ago
  ::Time.now - self
end

#bytesObject Also known as: byte



82
83
84
# File 'lib/eye/utils/mini_active_support.rb', line 82

def bytes
  self
end

#daysObject Also known as: day



68
69
70
# File 'lib/eye/utils/mini_active_support.rb', line 68

def days
  self * 86400
end

#gigabytesObject Also known as: gigabyte



97
98
99
# File 'lib/eye/utils/mini_active_support.rb', line 97

def gigabytes
  self * 1024 * 1024 * 1024
end

#hoursObject Also known as: hour



63
64
65
# File 'lib/eye/utils/mini_active_support.rb', line 63

def hours
  self * 3600
end

#kilobytesObject Also known as: kilobyte



87
88
89
# File 'lib/eye/utils/mini_active_support.rb', line 87

def kilobytes
  self * 1024
end

#megabytesObject Also known as: megabyte



92
93
94
# File 'lib/eye/utils/mini_active_support.rb', line 92

def megabytes
  self * 1024 * 1024
end

#minutesObject Also known as: minute



58
59
60
# File 'lib/eye/utils/mini_active_support.rb', line 58

def minutes
  self * 60
end

#secondsObject Also known as: second



53
54
55
# File 'lib/eye/utils/mini_active_support.rb', line 53

def seconds
  self
end

#terabytesObject Also known as: terabyte



102
103
104
# File 'lib/eye/utils/mini_active_support.rb', line 102

def terabytes
  self * 1024 * 1024 * 1024 * 1024
end

#weeksObject Also known as: week



73
74
75
# File 'lib/eye/utils/mini_active_support.rb', line 73

def weeks
  self * 86400 * 7
end