Class: Hash
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#[](*fkeys) ⇒ Object
78 79 80 |
# File 'lib/ext/hash.rb', line 78 def [](*fkeys) fkeys.map { |key| mlookup(key) || mfetch(key.sym) { mfetch(key.to_s) { mfetch(ki(key).sym) { mfetch(ki(key).to_s) { mdef(key) } } } } }.sequester end |
#mlookup ⇒ Object
74 |
# File 'lib/ext/hash.rb', line 74 alias_method :mlookup, :[] |
#sym(recurse = false) ⇒ Object
82 83 84 85 86 |
# File 'lib/ext/hash.rb', line 82 def sym(recurse=false) each.with_object({}) do |(key, value), o| o[key.sym] = recurse ? value.sym : value end end |