module UserAgent::Comparable
A custom Comparable
module that will always return false if the <=> returns false
Public Instance Methods
Source
# File lib/user_agent/comparable.rb, line 5 def <(other) (c = self <=> other) ? c == -1 : false end
Source
# File lib/user_agent/comparable.rb, line 9 def <=(other) (c = self <=> other) ? c == -1 || c == 0 : false end
Source
# File lib/user_agent/comparable.rb, line 13 def ==(other) (c = self <=> other) ? c == 0 : false end
Source
# File lib/user_agent/comparable.rb, line 17 def >(other) (c = self <=> other) ? c == 1 : false end
Source
# File lib/user_agent/comparable.rb, line 21 def >=(other) (c = self <=> other) ? c == 1 || c == 0 : false end