From 81640ecd848bdcd20de971f80bb975dc721c3477 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Sun, 10 Dec 2017 17:31:54 +0100 Subject: bugfix: new ruby version caused exception --- timestring.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'timestring.rb') diff --git a/timestring.rb b/timestring.rb index ff4a220..3f70104 100644 --- a/timestring.rb +++ b/timestring.rb @@ -55,8 +55,9 @@ class TimeString self <=> other end def <=>(other) + return -1 if other.class != TimeString if self.date == other.date - if self.time.class == String && other.time.class == String + if self.time.class == String && other.time.class == String self.time.to_i == other.time.to_i ? self.time <=> other.time : self.time.to_i <=> other.time.to_i elsif self.time.class == Time && other.time.class == Time self.time <=> other.time -- cgit v1.2.3