Sha256: b8871d3cc6f46cb37eaf3ed2d6cd045a3dba830805c4ec8f9a60fc46488762d1

Contents?: true

Size: 180 Bytes

Versions: 73

Compression:

Stored size: 180 Bytes

Contents

unless Hash.method_defined? :rassoc
  class Hash
    def rassoc(value)
      k = key(value)
      v = fetch(k){return nil}
      [k, fetch(k)] if k || v == value
    end
  end
end

Version data entries

73 entries across 73 versions & 5 rubygems

Version Path
backports-3.25.0 lib/backports/1.9.1/hash/rassoc.rb
backports-3.24.1 lib/backports/1.9.1/hash/rassoc.rb
backports-3.24.0 lib/backports/1.9.1/hash/rassoc.rb
backports-3.23.0 lib/backports/1.9.1/hash/rassoc.rb
backports-3.22.1 lib/backports/1.9.1/hash/rassoc.rb
backports-3.22.0 lib/backports/1.9.1/hash/rassoc.rb
backports-3.21.0 lib/backports/1.9.1/hash/rassoc.rb
backports-3.20.2 lib/backports/1.9.1/hash/rassoc.rb
backports-3.20.1 lib/backports/1.9.1/hash/rassoc.rb
backports-3.20.0 lib/backports/1.9.1/hash/rassoc.rb
backports-3.19.0 lib/backports/1.9.1/hash/rassoc.rb
backports-3.18.2 lib/backports/1.9.1/hash/rassoc.rb
backports-3.18.1 lib/backports/1.9.1/hash/rassoc.rb
backports-3.18.0 lib/backports/1.9.1/hash/rassoc.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/backports-3.12.0/lib/backports/1.9.1/hash/rassoc.rb
backports-3.17.2 lib/backports/1.9.1/hash/rassoc.rb
backports-3.17.1 lib/backports/1.9.1/hash/rassoc.rb
backports-3.17.0 lib/backports/1.9.1/hash/rassoc.rb
backports-3.16.1 lib/backports/1.9.1/hash/rassoc.rb
backports-3.16.0 lib/backports/1.9.1/hash/rassoc.rb