Sha256: 8f205e33dde3f61d172ea664f1ce1a221a8e1f919e41279083fca9cdd7fa199b

Contents?: true

Size: 228 Bytes

Versions: 3

Compression:

Stored size: 228 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

3 entries across 3 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 lib/core/facets/hash/each_with_key.rb
facets-3.1.0 lib/core/facets/hash/each_with_key.rb
facets-3.0.0 lib/core/facets/hash/each_with_key.rb