Module: Dcha::MPT::Node::ToHashable

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#to_hObject



6
7
8
9
10
11
12
13
# File 'lib/dcha/mpt/node/to_hashable.rb', line 6

def to_h
  case type
  when :blank then {}
  when :branch then branch_to_h
  when :leaf, :extension
    kv_to_h
  end
end