Module: Waves::Ext::Integer
- Included in:
- Integer
- Defined in:
- lib/waves/ext/integer.rb
Instance Method Summary collapse
- #bytes ⇒ Object (also: #byte)
- #days ⇒ Object (also: #day)
- #exabytes ⇒ Object (also: #exabyte)
- #gigabytes ⇒ Object (also: #gigabyte)
- #hours ⇒ Object (also: #hour)
- #kilobytes ⇒ Object (also: #kilobyte)
- #megabytes ⇒ Object (also: #megabyte)
- #minutes ⇒ Object (also: #minute)
- #petabytes ⇒ Object (also: #petabyte)
-
#seconds ⇒ Object
(also: #second)
@todo: we need to credit where this code came from originally, if anywhere.
- #terabytes ⇒ Object (also: #terabyte)
- #to_delimited(delim = ',') ⇒ Object
- #weeks ⇒ Object (also: #week)
- #yottabytes ⇒ Object (also: #yottabyte)
- #zettabytes ⇒ Object (also: #zettabyte)
Instance Method Details
#bytes ⇒ Object Also known as: byte
15 |
# File 'lib/waves/ext/integer.rb', line 15 def bytes ; self ; end |
#days ⇒ Object Also known as: day
11 |
# File 'lib/waves/ext/integer.rb', line 11 def days ; self * 24.hours ; end |
#exabytes ⇒ Object Also known as: exabyte
27 |
# File 'lib/waves/ext/integer.rb', line 27 def exabytes ; self * 1024.petabytes ; end |
#gigabytes ⇒ Object Also known as: gigabyte
21 |
# File 'lib/waves/ext/integer.rb', line 21 def gigabytes ; self * 1024.megabytes ; end |
#hours ⇒ Object Also known as: hour
9 |
# File 'lib/waves/ext/integer.rb', line 9 def hours ; self * 60.minutes ; end |
#kilobytes ⇒ Object Also known as: kilobyte
17 |
# File 'lib/waves/ext/integer.rb', line 17 def kilobytes ; self * 1024 ; end |
#megabytes ⇒ Object Also known as: megabyte
19 |
# File 'lib/waves/ext/integer.rb', line 19 def megabytes ; self * 1024.kilobytes ; end |
#minutes ⇒ Object Also known as: minute
7 |
# File 'lib/waves/ext/integer.rb', line 7 def minutes ; self * 60 ; end |
#petabytes ⇒ Object Also known as: petabyte
25 |
# File 'lib/waves/ext/integer.rb', line 25 def petabytes ; self * 1024.terabytes ; end |
#seconds ⇒ Object 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 |
#terabytes ⇒ Object 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 |
#weeks ⇒ Object Also known as: week
13 |
# File 'lib/waves/ext/integer.rb', line 13 def weeks ; self * 7.days ; end |
#yottabytes ⇒ Object Also known as: yottabyte
31 |
# File 'lib/waves/ext/integer.rb', line 31 def yottabytes ; self * 1024.zettabytes ; end |
#zettabytes ⇒ Object Also known as: zettabyte
29 |
# File 'lib/waves/ext/integer.rb', line 29 def zettabytes ; self * 1024.exabytes ; end |