Module: Dcha::MPT::Node::Editable

Included in:
Dcha::MPT::Node
Defined in:
lib/dcha/mpt/node/editable.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#update(key, value) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/dcha/mpt/node/editable.rb', line 7

def update(key, value)
  case type
  when :blank then
    dup.clear.push key.terminate(true).encode, value
  when :branch then update_branch(key, value)
  when :leaf then update_leaf(key, value)
  else update_extension(key, value)
  end
end