lib/yzz/side.rb in yzz-2.0.10 vs lib/yzz/side.rb in yzz-2.0.11

- old
+ new

@@ -55,14 +55,18 @@ end return old_neighbor end alias * crossover - # Given a Yzz object, returns its side along the dimension same as the + # Given a +Yzz+ object, returns its side along the dimension same as the # receiver's dimension, in the direction opposite to self. # def opposite_side( of: zz ) - of.along( dimension ).send ::Yzz::Side::OPPOSITE[ direction ] + opposite = case direction + when :posward then :negward + when :negward then :posward + else fail "Unknown direction!" end + of.along( dimension ).send( opposite ) end # Unlinks the neighbor, returning it. # def unlink