Class: Rope::Node
- Inherits:
-
Object
- Object
- Rope::Node
- Defined in:
- lib/rope/node.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
The underlying data in the tree.
-
#depth ⇒ Object
readonly
Depth of the tree.
-
#length ⇒ Object
readonly
Length of the underlying data in the tree and its descendants.
Instance Method Summary collapse
-
#+(other) ⇒ Object
Concatenates this tree with another tree (non-destructive to either tree).
-
#rebalance! ⇒ Object
Rebalances this tree.
-
#to_s ⇒ Object
Gets the string representation of the underlying data in the tree.
Instance Attribute Details
#data ⇒ Object (readonly)
The underlying data in the tree
10 11 12 |
# File 'lib/rope/node.rb', line 10 def data @data end |
#depth ⇒ Object (readonly)
Depth of the tree
7 8 9 |
# File 'lib/rope/node.rb', line 7 def depth @depth end |
#length ⇒ Object (readonly)
Length of the underlying data in the tree and its descendants
4 5 6 |
# File 'lib/rope/node.rb', line 4 def length @length end |
Instance Method Details
#+(other) ⇒ Object
Concatenates this tree with another tree (non-destructive to either tree)
14 15 16 |
# File 'lib/rope/node.rb', line 14 def +(other) ConcatenationNode.new(self, other) end |
#rebalance! ⇒ Object
Rebalances this tree
24 25 |
# File 'lib/rope/node.rb', line 24 def rebalance! end |
#to_s ⇒ Object
Gets the string representation of the underlying data in the tree
19 20 21 |
# File 'lib/rope/node.rb', line 19 def to_s data.to_s end |