Method: Puppet::Graph::RbTreeMap#push

Defined in:
lib/puppet/graph/rb_tree_map.rb

#push(key, value) ⇒ Object Also known as: []=

Insert an item with an associated key into the TreeMap, and returns the item inserted

Complexity: O(log n)

map = Containers::TreeMap.new map.push(“MA”, “Massachusetts”) #=> “Massachusetts” map.get(“MA”) #=> “Massachusetts”



55
56
57
58
59
# File 'lib/puppet/graph/rb_tree_map.rb', line 55

def push(key, value)
  @root = insert(@root, key, value)
  @root.color = :black
  value
end