# File lib/facet/nil-comparable.rb, line 74 def self.included( mod ) mod.class_eval %{ if method_defined?( :<=> ) alias_method :compare_without_nil, :<=> else def compare_without_nil( other ) raise TypeError, "Cannot compare \#{self.inspect} to \#{other.inspect}" end end def <=>( other ) return 1 if other.nil? compare_without_nil( other ) end } end