Class: Xunch::RBTree::ImmutableNode

Inherits:
Object
  • Object
show all
Defined in:
lib/xunch/utils/rb_tree_node.rb

Overview

class RBTree::Node

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value) ⇒ ImmutableNode

Returns a new instance of ImmutableNode.



52
53
54
55
# File 'lib/xunch/utils/rb_tree_node.rb', line 52

def initialize(key, value)
  @key = key
  @value = value
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



49
50
51
# File 'lib/xunch/utils/rb_tree_node.rb', line 49

def key
  @key
end

#valueObject (readonly)

Returns the value of attribute value.



50
51
52
# File 'lib/xunch/utils/rb_tree_node.rb', line 50

def value
  @value
end

Instance Method Details

#inspectObject



57
58
59
# File 'lib/xunch/utils/rb_tree_node.rb', line 57

def inspect
  "#{@key}=#{@value}"
end

#to_sObject



61
62
63
# File 'lib/xunch/utils/rb_tree_node.rb', line 61

def to_s
  "#{@key}=#{@value}"
end