lib/dither/param.rb in dither-0.0.4 vs lib/dither/param.rb in dither-0.0.5
- old
+ new
@@ -1,4 +1,19 @@
module Dither
- Param = Struct.new(:i, :j)
-end
+ Param = Struct.new(:i, :j) do
+ def <=>(param)
+ return 1 if param.unbound?
+
+ a = i <=> param.i
+ if a == 0
+ return j <=> param.j
+ else
+ return a
+ end
+ end
+
+ def unbound?
+ false
+ end
+ end # Param
+end # Dither