Module: Waves::Ext::Integer

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

Instance Method Summary collapse

Instance Method Details

#bytesObject Also known as: byte



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

def bytes ; self ; end

#daysObject Also known as: day



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

def days ; self * 24.hours ; end

#exabytesObject Also known as: exabyte



27
# File 'lib/waves/ext/integer.rb', line 27

def exabytes ; self * 1024.petabytes ; end

#gigabytesObject Also known as: gigabyte



21
# File 'lib/waves/ext/integer.rb', line 21

def gigabytes ; self * 1024.megabytes ; end

#hoursObject Also known as: hour



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

def hours ; self * 60.minutes ; end

#kilobytesObject Also known as: kilobyte



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

def kilobytes ; self * 1024 ; end

#megabytesObject Also known as: megabyte



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

def megabytes ; self * 1024.kilobytes ; end

#minutesObject Also known as: minute



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

def minutes ; self * 60 ; end

#petabytesObject Also known as: petabyte



25
# File 'lib/waves/ext/integer.rb', line 25

def petabytes ; self * 1024.terabytes ; end

#secondsObject Also known as: second

@todo: we need to credit where this code came from originally, if anywhere.



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

def seconds ; self ; end

#terabytesObject Also known as: terabyte



23
# File 'lib/waves/ext/integer.rb', line 23

def terabytes ; self * 1024.gigabytes ; end

#to_delimited(delim = ',') ⇒ Object



33
34
35
# File 'lib/waves/ext/integer.rb', line 33

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

#weeksObject Also known as: week



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

def weeks ; self * 7.days ; end

#yottabytesObject Also known as: yottabyte



31
# File 'lib/waves/ext/integer.rb', line 31

def yottabytes ; self * 1024.zettabytes ; end

#zettabytesObject Also known as: zettabyte



29
# File 'lib/waves/ext/integer.rb', line 29

def zettabytes ; self * 1024.exabytes ; end