Class: RBTree::GuardNode

Inherits:
Node
  • Object
show all
Defined in:
lib/rbtree/guard_node.rb

Overview

Node instance used as a guard.

Instance Attribute Summary

Attributes inherited from Node

#color, #key, #left, #parent, #right, #value

Instance Method Summary collapse

Methods inherited from Node

#black?, #red?, #to_single_a

Constructor Details

#initializeGuardNode

Returns a new instance of GuardNode.



6
7
8
9
10
11
12
13
# File 'lib/rbtree/guard_node.rb', line 6

def initialize
  @color = :black
  @key = nil
  @value = nil
  @left = nil
  @right = nil
  @parent = nil
end

Instance Method Details

#inspectObject



23
24
25
# File 'lib/rbtree/guard_node.rb', line 23

def inspect
  'RBTree::GuardNode'
end

#nil?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/rbtree/guard_node.rb', line 15

def nil?
  true
end

#to_aObject



19
20
21
# File 'lib/rbtree/guard_node.rb', line 19

def to_a
  nil
end