Class: Numeric

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

Instance Method Summary collapse

Instance Method Details

#agoObject



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

def ago
  ::Time.now - self
end

#bytesObject Also known as: byte



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

def bytes
  self
end

#daysObject Also known as: day



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

def days
  self * 86400
end

#gigabytesObject Also known as: gigabyte



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

def gigabytes
  self * 1024 * 1024 * 1024
end

#hoursObject Also known as: hour



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

def hours
  self * 3600
end

#kilobytesObject Also known as: kilobyte



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

def kilobytes
  self * 1024
end

#megabytesObject Also known as: megabyte



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

def megabytes
  self * 1024 * 1024
end

#minutesObject Also known as: minute



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

def minutes
  self * 60
end

#percentsObject Also known as: percent



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

def percents
  self
end

#secondsObject Also known as: second



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

def seconds
  self
end

#terabytesObject 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

#weeksObject Also known as: week



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

def weeks
  self * 86400 * 7
end