Sha256: 712e749cf7b7801508af101c9e49b81fa27da8d963591646642c63e0dcdc2520

Contents?: true

Size: 381 Bytes

Versions: 17

Compression:

Stored size: 381 Bytes

Contents

require 'backports/2.0.0/hash/to_h' unless Hash.method_defined? :to_h

if {:n => true}.to_h {[:ok, true]}[:n]
  require 'backports/tools/alias_method_chain'
  require 'backports/2.1.0/array/to_h'

  class Hash
    def to_h_with_block(&block)
      return to_h_without_block unless block
      map(&block).to_h
    end
    Backports.alias_method_chain self, :to_h, :block
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
backports-3.25.0 lib/backports/2.6.0/hash/to_h.rb
backports-3.24.1 lib/backports/2.6.0/hash/to_h.rb
backports-3.24.0 lib/backports/2.6.0/hash/to_h.rb
backports-3.23.0 lib/backports/2.6.0/hash/to_h.rb
backports-3.22.1 lib/backports/2.6.0/hash/to_h.rb
backports-3.22.0 lib/backports/2.6.0/hash/to_h.rb
backports-3.21.0 lib/backports/2.6.0/hash/to_h.rb
backports-3.20.2 lib/backports/2.6.0/hash/to_h.rb
backports-3.20.1 lib/backports/2.6.0/hash/to_h.rb
backports-3.20.0 lib/backports/2.6.0/hash/to_h.rb
backports-3.19.0 lib/backports/2.6.0/hash/to_h.rb
backports-3.18.2 lib/backports/2.6.0/hash/to_h.rb
backports-3.18.1 lib/backports/2.6.0/hash/to_h.rb
backports-3.18.0 lib/backports/2.6.0/hash/to_h.rb
backports-3.17.2 lib/backports/2.6.0/hash/to_h.rb
backports-3.17.1 lib/backports/2.6.0/hash/to_h.rb
backports-3.17.0 lib/backports/2.6.0/hash/to_h.rb