Sha256: af5c1c6cf008817d1789838cd6112284548894957a53b82fb187c21fcd8dec01

Contents?: true

Size: 172 Bytes

Versions: 6

Compression:

Stored size: 172 Bytes

Contents

# coding: utf-8

class Hash
  def hmap(&block)
    reduce({}) { |hash, (k, v)| hash.merge(block.call(k, v)) }
  end

  def hmap!(&block)
    replace hmap(&block)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bombard-0.1.0 lib/core_ext/hash.rb
bombard-0.0.6 lib/core_ext/hash.rb
bombard-0.0.5 lib/core_ext/hash.rb
bombard-0.0.4 lib/core_ext/hash.rb
bombard-0.0.3 lib/core_ext/hash.rb
bombard-0.0.2 lib/core_ext/hash.rb