Class: Integer

Inherits:
Object show all
Defined in:
lib/utilities/integer.rb

Overview

Added methods to Integer for commonly used “numeric phrases” like 6.days or 30.megabytes.

Instance Method Summary collapse

Instance Method Details

#bytesObject



8
# File 'lib/utilities/integer.rb', line 8

def bytes ; self ; end

#daysObject



6
# File 'lib/utilities/integer.rb', line 6

def days ; self * 24.hours ; end

#exabytesObject



14
# File 'lib/utilities/integer.rb', line 14

def exabytes ; self * 1024.petabytes ; end

#gigabytesObject



11
# File 'lib/utilities/integer.rb', line 11

def gigabytes ; self * 1024.megabytes ; end

#hoursObject



5
# File 'lib/utilities/integer.rb', line 5

def hours ; self * 60.minutes ; end

#kilobytesObject



9
# File 'lib/utilities/integer.rb', line 9

def kilobytes ; self * 1024 ; end

#megabytesObject



10
# File 'lib/utilities/integer.rb', line 10

def megabytes ; self * 1024.kilobytes ; end

#minutesObject



4
# File 'lib/utilities/integer.rb', line 4

def minutes ; self * 60 ; end

#petabytesObject



13
# File 'lib/utilities/integer.rb', line 13

def petabytes ; self * 1024.terabytes ; end

#secondsObject



3
# File 'lib/utilities/integer.rb', line 3

def seconds ; self ; end

#terabytesObject



12
# File 'lib/utilities/integer.rb', line 12

def terabytes ; self * 1024.gigabytes ; end

#weeksObject



7
# File 'lib/utilities/integer.rb', line 7

def weeks ; self * 7.days ; end

#yottabytesObject



16
# File 'lib/utilities/integer.rb', line 16

def yottabytes ; self * 1024.zettabytes ; end

#zettabytesObject



15
# File 'lib/utilities/integer.rb', line 15

def zettabytes ; self * 1024.exabytes ; end