lib/yzz/side.rb in yzz-2.0.5 vs lib/yzz/side.rb in yzz-2.0.7
- old
+ new
@@ -64,16 +64,10 @@
end
return old_neighbor
end
alias * crossover
- # Returns the string briefly describing the instance.
- #
- def to_s
- "#<YTed::Zz::Side: #{direction} side of #{zz} along #{dimension}>"
- end
-
# Given a zz object (named argument :of), returns its side along same
# dimension, in the direction same as self.
#
def same_side( of: raise( ArgumentError, "Zz object (:of) absent!" ) )
of.along( dimension ).send direction
@@ -90,9 +84,27 @@
#
def unlink
unlink!.tap do |neighbor|
opposite_side( of: neighbor ).unlink! if neighbor.is_a_zz?
end
+ end
+
+ # Returns the "side label" string.
+ #
+ def label
+ direction == :posward ? "#{dimension}->" : "<-#{dimension}"
+ end
+
+ # Returns the string briefly describing the instance.
+ #
+ def to_s
+ "#<Yzz::Side: #{zz} along #{dimension}, #{direction}>"
+ end
+
+ # Inspect string of the instance.
+ #
+ def inspect
+ to_s
end
protected
# Sets neighbor carelessly, returning the old neighbor.