Class: Numeric

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

Instance Method Summary collapse

Instance Method Details

#agoObject


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

def ago
  ::Time.now - self
end

#bytesObject Also known as: byte


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

def bytes
  self
end

#daysObject Also known as: day


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

def days
  self * 86_400
end

#gigabytesObject Also known as: gigabyte


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

def gigabytes
  self * 1024 * 1024 * 1024
end

#hoursObject Also known as: hour


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

def hours
  self * 3600
end

#kilobytesObject Also known as: kilobyte


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

def kilobytes
  self * 1024
end

#megabytesObject Also known as: megabyte


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

def megabytes
  self * 1024 * 1024
end

#minutesObject Also known as: minute


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

def minutes
  self * 60
end

#percentsObject Also known as: percent


49
50
51
# File 'lib/eye/utils/mini_active_support.rb', line 49

def percents
  self
end

#secondsObject Also known as: second


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

def seconds
  self
end

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

#weeksObject Also known as: week


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

def weeks
  self * 86_400 * 7
end