Module: Vnstat::Result::TimeComparable
Overview
A module that is included by result types that can be compared based on their particular time information.
Instance Method Summary collapse
Instance Method Details
#<=>(other) ⇒ Integer?
11 12 13 14 15 16 |
# 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 |