Class: AsciiTree::Edge
- Inherits:
-
Object
- Object
- AsciiTree::Edge
- Defined in:
- lib/ascii_tree/edge.rb
Instance Attribute Summary collapse
-
#character ⇒ Object
readonly
Returns the value of attribute character.
-
#child_coordinate ⇒ Object
readonly
Returns the value of attribute child_coordinate.
-
#coordinate ⇒ Object
readonly
Returns the value of attribute coordinate.
-
#parent_coordinate ⇒ Object
readonly
Returns the value of attribute parent_coordinate.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(character:, coordinate:, parent_coordinate:, child_coordinate:) ⇒ Edge
constructor
A new instance of Edge.
Constructor Details
#initialize(character:, coordinate:, parent_coordinate:, child_coordinate:) ⇒ Edge
Returns a new instance of Edge.
5 6 7 8 9 10 |
# File 'lib/ascii_tree/edge.rb', line 5 def initialize(character:, coordinate:, parent_coordinate:, child_coordinate:) @character = character @coordinate = coordinate @parent_coordinate = parent_coordinate @child_coordinate = child_coordinate end |
Instance Attribute Details
#character ⇒ Object (readonly)
Returns the value of attribute character.
3 4 5 |
# File 'lib/ascii_tree/edge.rb', line 3 def character @character end |
#child_coordinate ⇒ Object (readonly)
Returns the value of attribute child_coordinate.
3 4 5 |
# File 'lib/ascii_tree/edge.rb', line 3 def child_coordinate @child_coordinate end |
#coordinate ⇒ Object (readonly)
Returns the value of attribute coordinate.
3 4 5 |
# File 'lib/ascii_tree/edge.rb', line 3 def coordinate @coordinate end |
#parent_coordinate ⇒ Object (readonly)
Returns the value of attribute parent_coordinate.
3 4 5 |
# File 'lib/ascii_tree/edge.rb', line 3 def parent_coordinate @parent_coordinate end |
Instance Method Details
#==(other) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/ascii_tree/edge.rb', line 12 def ==(other) character == other.character && coordinate == other.coordinate && parent_coordinate == other.parent_coordinate && child_coordinate == other.child_coordinate end |