Module: Waves::Ext::Integer
- Included in:
- Integer
- Defined in:
- lib/ext/integer.rb
Instance Method Summary collapse
- #bytes ⇒ Object
- #days ⇒ Object
- #exabytes ⇒ Object
- #gigabytes ⇒ Object
- #hours ⇒ Object
- #kilobytes ⇒ Object
- #megabytes ⇒ Object
- #minutes ⇒ Object
- #petabytes ⇒ Object
- #seconds ⇒ Object
- #terabytes ⇒ Object
- #to_delimited(delim = ',') ⇒ Object
- #weeks ⇒ Object
- #yottabytes ⇒ Object
- #zettabytes ⇒ Object
Instance Method Details
#bytes ⇒ Object
9 |
# File 'lib/ext/integer.rb', line 9 def bytes ; self ; end |
#days ⇒ Object
7 |
# File 'lib/ext/integer.rb', line 7 def days ; self * 24.hours ; end |
#exabytes ⇒ Object
15 |
# File 'lib/ext/integer.rb', line 15 def exabytes ; self * 1024.petabytes ; end |
#gigabytes ⇒ Object
12 |
# File 'lib/ext/integer.rb', line 12 def gigabytes ; self * 1024.megabytes ; end |
#hours ⇒ Object
6 |
# File 'lib/ext/integer.rb', line 6 def hours ; self * 60.minutes ; end |
#kilobytes ⇒ Object
10 |
# File 'lib/ext/integer.rb', line 10 def kilobytes ; self * 1024 ; end |
#megabytes ⇒ Object
11 |
# File 'lib/ext/integer.rb', line 11 def megabytes ; self * 1024.kilobytes ; end |
#minutes ⇒ Object
5 |
# File 'lib/ext/integer.rb', line 5 def minutes ; self * 60 ; end |
#petabytes ⇒ Object
14 |
# File 'lib/ext/integer.rb', line 14 def petabytes ; self * 1024.terabytes ; end |
#seconds ⇒ Object
4 |
# File 'lib/ext/integer.rb', line 4 def seconds ; self ; end |
#terabytes ⇒ Object
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 |
#weeks ⇒ Object
8 |
# File 'lib/ext/integer.rb', line 8 def weeks ; self * 7.days ; end |
#yottabytes ⇒ Object
17 |
# File 'lib/ext/integer.rb', line 17 def yottabytes ; self * 1024.zettabytes ; end |
#zettabytes ⇒ Object
16 |
# File 'lib/ext/integer.rb', line 16 def zettabytes ; self * 1024.exabytes ; end |