Module: Waves::Ext::Integer

Included in:
Integer
Defined in:
lib/ext/integer.rb

Instance Method Summary collapse

Instance Method Details

#bytesObject



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

def bytes ; self ; end

#daysObject



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

def days ; self * 24.hours ; end

#exabytesObject



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

def exabytes ; self * 1024.petabytes ; end

#gigabytesObject



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

def gigabytes ; self * 1024.megabytes ; end

#hoursObject



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

def hours ; self * 60.minutes ; end

#kilobytesObject



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

def kilobytes ; self * 1024 ; end

#megabytesObject



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

def megabytes ; self * 1024.kilobytes ; end

#minutesObject



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

def minutes ; self * 60 ; end

#petabytesObject



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

def petabytes ; self * 1024.terabytes ; end

#secondsObject



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

def seconds ; self ; end

#terabytesObject



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

def terabytes ; self * 1024.gigabytes ; end

#to_delimited(delim = ',') ⇒ Object



18
19
20
# File 'lib/ext/integer.rb', line 18

def to_delimited(delim=',')
  self.to_s.gsub(/(\d)(?=(\d\d\d)+$)/, "\\1#{delim}")
end

#weeksObject



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

def weeks ; self * 7.days ; end

#yottabytesObject



17
# File 'lib/ext/integer.rb', line 17

def yottabytes ; self * 1024.zettabytes ; end

#zettabytesObject



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

def zettabytes ; self * 1024.exabytes ; end