Class: Humanize::Byte
Constant Summary
Constants inherited
from Bytes
Humanize::Bytes::VERSION
Instance Method Summary
collapse
Methods inherited from Bytes
#initialize, #to_s, #value
Instance Method Details
#to_b ⇒ Object
3
4
5
|
# File 'lib/humanize/byte.rb', line 3
def to_b
self
end
|
#to_e ⇒ Object
27
28
29
|
# File 'lib/humanize/byte.rb', line 27
def to_e
Exa.new @value / 1024.0 / 1024.0 / 1024.0 / 1024.0 / 1024.0 / 1024.0
end
|
#to_g ⇒ Object
15
16
17
|
# File 'lib/humanize/byte.rb', line 15
def to_g
Giga.new @value / 1024.0 / 1024 / 1024
end
|
#to_k ⇒ Object
7
8
9
|
# File 'lib/humanize/byte.rb', line 7
def to_k
Kilo.new @value / 1024.0
end
|
#to_m ⇒ Object
11
12
13
|
# File 'lib/humanize/byte.rb', line 11
def to_m
Mega.new @value / 1024.0 / 1024
end
|
#to_p ⇒ Object
23
24
25
|
# File 'lib/humanize/byte.rb', line 23
def to_p
Peta.new @value / 1024.0 / 1024.0 / 1024.0 / 1024.0 / 1024.0
end
|
#to_t ⇒ Object
19
20
21
|
# File 'lib/humanize/byte.rb', line 19
def to_t
Tera.new @value / 1024.0 / 1024.0 / 1024.0 / 1024.0
end
|
#to_y ⇒ Object
35
36
37
|
# File 'lib/humanize/byte.rb', line 35
def to_y
Yotta.new @value / 1024.0 / 1024.0 / 1024.0 / 1024.0 / 1024.0 / 1024.0 / 1024.0 / 1024.0
end
|
#to_z ⇒ Object
31
32
33
|
# File 'lib/humanize/byte.rb', line 31
def to_z
Zetta.new @value / 1024.0 / 1024.0 / 1024.0 / 1024.0 / 1024.0 / 1024.0 / 1024.0
end
|