Class: Rux::Tree

Inherits:
Data
  • Object
show all
Defined in:
lib/rux.rb,
ext/rux/rux.c

Overview

A key-value data store backed by a `rax` Radix tree.

Instance Method Summary collapse

Instance Method Details

#delete(*args) ⇒ Object

Deletes `key` from the tree, returning its value if it was present, or `fallback` if it wasn't present.


37
# File 'lib/rux.rb', line 37

alias :[] :get

#eachvoid

This method returns an undefined value.

Yields each key-value pair to a block, in lexicographical order.


37
# File 'lib/rux.rb', line 37

alias :[] :get

#get(*args) ⇒ Object Also known as: []

Gets the value for `key` in the tree, or `fallback` if it's not present


37
# File 'lib/rux.rb', line 37

alias :[] :get

#node_sizeInteger

Just for fun.


37
# File 'lib/rux.rb', line 37

alias :[] :get

#set(*args) ⇒ Object Also known as: []=

Sets `key` equal to `value` in the tree. Returns the previous value or `fallback`


37
# File 'lib/rux.rb', line 37

alias :[] :get

#showvoid

This method returns an undefined value.

Prints a representation of the tree to STDOUT. Just for fun.


37
# File 'lib/rux.rb', line 37

alias :[] :get

#sizeInteger


37
# File 'lib/rux.rb', line 37

alias :[] :get