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