Class: Vidibus::Sysinfo::Throughput::Result

Inherits:
Result
  • Object
show all
Defined in:
lib/vidibus/sysinfo/throughput.rb

Instance Method Summary collapse

Methods inherited from Result

#[], attrs, #initialize

Methods included from Helper

#round

Constructor Details

This class inherits a constructor from Vidibus::Sysinfo::Result

Instance Method Details

#to_fObject



26
27
28
# File 'lib/vidibus/sysinfo/throughput.rb', line 26

def to_f
  total.to_f
end

#to_hObject



14
15
16
# File 'lib/vidibus/sysinfo/throughput.rb', line 14

def to_h
  super.merge(total: total)
end

#to_iObject



22
23
24
# File 'lib/vidibus/sysinfo/throughput.rb', line 22

def to_i
  round(total, 0).to_i
end

#totalObject



18
19
20
# File 'lib/vidibus/sysinfo/throughput.rb', line 18

def total
  round(input + output)
end