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