module Vnstat::Result::TimeComparable

A module that is included by result types that can be compared based on their particular time information.

Public Instance Methods

<=>(other) click to toggle source

@return [Integer, nil]

# File lib/vnstat/result/time_comparable.rb, line 11
def <=>(other)
  return nil unless other.respond_to?(:bytes_transmitted)
  return nil unless other.respond_to?(:time)

  [time, bytes_transmitted] <=> [other.time, other.bytes_transmitted]
end