Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll-multiple-languages-plugin.rb

Instance Method Summary collapse

Instance Method Details

#access(path) ⇒ Object

access



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'lib/jekyll-multiple-languages-plugin.rb', line 542

def access(path)
  ret = self
  
  path.split('.').each do |p|
  
    if p.to_i.to_s == p
      ret = ret[p.to_i]
    else
      ret = ret[p.to_s] || ret[p.to_sym]
    end
    
    break unless ret
  end
  
  ret
end