Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/graft/lib/graft/core_ext/hash.rb

Instance Method Summary collapse

Instance Method Details

#/(path) ⇒ Object



3
4
5
6
7
# File 'lib/graft/lib/graft/core_ext/hash.rb', line 3

def /(path)
  path.to_s.split('/').inject(self) do |data, key|
    (data.is_a?(Hash) && data[key]) ? data[key] : nil
  end
end