Class: Vidibus::Sysinfo::Traffic::Result

Inherits:
Result
  • Object
show all
Defined in:
lib/vidibus/sysinfo/traffic.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



30
31
32
# File 'lib/vidibus/sysinfo/traffic.rb', line 30

def to_f
  total.to_f
end

#to_hObject



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

def to_h
  super.merge(total: total)
end

#to_iObject



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

def to_i
  round(total, 0).to_i
end

#totalObject



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

def total
  round(input + output)
end