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

#bytes ⇒ Object



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

def bytes ; self ; end

#days ⇒ Object



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

def days ; self * 24.hours ; end

#exabytes ⇒ Object



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

def exabytes ; self * 1024.petabytes ; end

#gigabytes ⇒ Object



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

def gigabytes ; self * 1024.megabytes ; end

#hours ⇒ Object



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

def hours ; self * 60.minutes ; end

#kilobytes ⇒ Object



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

def kilobytes ; self * 1024 ; end

#megabytes ⇒ Object



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

def megabytes ; self * 1024.kilobytes ; end

#minutes ⇒ Object



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

def minutes ; self * 60 ; end

#petabytes ⇒ Object



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

def petabytes ; self * 1024.terabytes ; end

#seconds ⇒ Object



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

def seconds ; self ; end

#terabytes ⇒ Object



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

def terabytes ; self * 1024.gigabytes ; end

#weeks ⇒ Object



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

def weeks ; self * 7.days ; end

#yottabytes ⇒ Object



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

def yottabytes ; self * 1024.zettabytes ; end

#zettabytes ⇒ Object



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

def zettabytes ; self * 1024.exabytes ; end