Class: Yzz::NegwardSide
- Includes:
- Side
- Defined in:
- lib/yzz/negward_side.rb
Overview
Separate class for negward sides of zz objects.
Instance Attribute Summary
Attributes included from Side
Instance Method Summary collapse
-
#direction ⇒ Object
The direction of a NegwardSide is always :negward.
-
#label ⇒ Object
Returns the “side label” string.
-
#opposite_direction ⇒ Object
Opposite direction of a NegwardSide is always :negward.
-
#opposite_side(of: zz) ⇒ Object
Given a
Yzz
object, returns its posward side along the dimension same as the receiver’s dimension. -
#same_side(of: zz) ⇒ Object
Given a
Yzz
object, returns its negward side along the dimension same as the receiver’s dimension. -
#to_s ⇒ Object
Returns the string briefly describing the instance.
Methods included from Side
#crossover, #dimension, #initialize, #inspect, #link, #unlink, #zz
Instance Method Details
#direction ⇒ Object
The direction of a NegwardSide is always :negward.
8 |
# File 'lib/yzz/negward_side.rb', line 8 def direction; :negward end |
#label ⇒ Object
Returns the “side label” string.
32 33 34 |
# File 'lib/yzz/negward_side.rb', line 32 def label "<-#{dimension}" end |
#opposite_direction ⇒ Object
Opposite direction of a NegwardSide is always :negward.
12 |
# File 'lib/yzz/negward_side.rb', line 12 def opposite_direction; :posward end |
#opposite_side(of: zz) ⇒ Object
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.
26 27 28 |
# File 'lib/yzz/negward_side.rb', line 26 def opposite_side( of: zz ) of.along( dimension ).posward end |
#same_side(of: zz) ⇒ Object
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.
18 19 20 |
# File 'lib/yzz/negward_side.rb', line 18 def same_side( of: zz ) of.along( dimension ).negward end |
#to_s ⇒ Object
Returns the string briefly describing the instance.
38 39 40 |
# File 'lib/yzz/negward_side.rb', line 38 def to_s "#<Yzz::NegwardSide of #{zz} along #{dimension}>" end |