Class: Rope::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/rope/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject (readonly)

The underlying data in the tree



10
11
12
# File 'lib/rope/node.rb', line 10

def data
  @data
end

#depthObject (readonly)

Depth of the tree



7
8
9
# File 'lib/rope/node.rb', line 7

def depth
  @depth
end

#lengthObject (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_sObject

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