class Yzz::NegwardSide

Separate class for negward sides of zz objects.

Public Instance Methods

direction() click to toggle source

The direction of a NegwardSide is always :negward.

# File lib/yzz/negward_side.rb, line 8
def direction; :negward end
label() click to toggle source

Returns the “side label” string.

# File lib/yzz/negward_side.rb, line 32
def label
  "<-#{dimension}"
end
opposite_direction() click to toggle source

Opposite direction of a NegwardSide is always :negward.

# File lib/yzz/negward_side.rb, line 12
def opposite_direction; :posward end
opposite_side( of: zz ) click to toggle source

Given a Yzz object, returns its posward side along the dimension same as the receiver's dimension. If no object is given, posward side opposite to the receiver is returned.

# File lib/yzz/negward_side.rb, line 26
def opposite_side( of: zz )
  of.along( dimension ).posward
end
same_side( of: zz ) click to toggle source

Given a Yzz object, returns its negward side along the dimension same as the receiver's dimension. If no object is given, the method simply returns the receiver.

# File lib/yzz/negward_side.rb, line 18
def same_side( of: zz )
  of.along( dimension ).negward
end
to_s() click to toggle source

Returns the string briefly describing the instance.

# File lib/yzz/negward_side.rb, line 38
def to_s
  "#<Yzz::NegwardSide of #{zz} along #{dimension}>"
end