Class: Vidibus::Sysinfo::Traffic::Result
- Inherits:
-
Result
- Object
- Result
- Vidibus::Sysinfo::Traffic::Result
show all
- Defined in:
- lib/vidibus/sysinfo/traffic.rb
Instance Method Summary
collapse
Methods inherited from Result
#[], attrs, #initialize
Methods included from Helper
#round
Instance Method Details
#to_f ⇒ Object
30
31
32
|
# File 'lib/vidibus/sysinfo/traffic.rb', line 30
def to_f
total.to_f
end
|
#to_h ⇒ Object
18
19
20
|
# File 'lib/vidibus/sysinfo/traffic.rb', line 18
def to_h
super.merge(total: total)
end
|
#to_i ⇒ Object
26
27
28
|
# File 'lib/vidibus/sysinfo/traffic.rb', line 26
def to_i
round(total, 0).to_i
end
|
#total ⇒ Object
22
23
24
|
# File 'lib/vidibus/sysinfo/traffic.rb', line 22
def total
round(input + output)
end
|