Class: VDF4R::Store

Inherits:
Hash
  • Object
show all
Defined in:
lib/vdf4r/store.rb

Instance Method Summary collapse

Constructor Details

#initializeStore

Returns a new instance of Store.



3
4
5
# File 'lib/vdf4r/store.rb', line 3

def initialize
  super { |h, k| h[k] = Store.new } # defaultdict(dict)
end

Instance Method Details

#traverse(path) ⇒ Object



7
8
9
# File 'lib/vdf4r/store.rb', line 7

def traverse(path)
  path.inject(self) { |current, path_component| current[path_component] }
end