Sha256: 29d996a49758f1211256fc7ce57e2a7d0a14328db32abe195ad90ccfbe3cb8f3

Contents?: true

Size: 230 Bytes

Versions: 2

Compression:

Stored size: 230 Bytes

Contents

class Hash

  # Each with key is like each_pair but reverses the order
  # the parameters to [value,key] instead of [key,value].
  #
  #   CREDIT: Trans

  def each_with_key( &yld )
    each_pair{ |k,v| yld.call(v,k) }
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
facets-2.2.1 lib/core/facets/hash/each_with_key.rb
facets-2.3.0 lib/core/facets/hash/each_with_key.rb