Method: UKPostcode::Tree#insert

Defined in:
lib/uk_postcode/tree.rb

#insert(path, value) ⇒ Object



7
8
9
# File 'lib/uk_postcode/tree.rb', line 7

def insert(path, value)
  path[0..-2].inject(@root) { |n, p| n[p] ||= {} }[path.last] = value
end