Sha256: 333226fc378377f9b1a426cb491bccae59807b2fe92fbc151ee4e31890d1eb4b
Contents?: true
Size: 336 Bytes
Versions: 37
Compression:
Stored size: 336 Bytes
Contents
require 'sugar-high/arguments' class Hash def hash_revert r = Hash.new {|h,k| h[k] = []} each {|k,v| r[v] << k} r end def try_keys *keys option = last_option keys keys.flatten.each do |key| return self[key] if self[key] end return option[:default] if option[:default] nil end end
Version data entries
37 entries across 37 versions & 1 rubygems