Sha256: 10d28352fdfee820ee4c3f327877ace52b6eabd6f3f6fc5413a4babbf155fab8

Contents?: true

Size: 448 Bytes

Versions: 25

Compression:

Stored size: 448 Bytes

Contents

require 'backports/2.1.0/enumerable/to_h' unless Enumerable.method_defined? :to_h

if Enumerable.instance_method(:to_h).bind([[:need, true]]).call { [:need, false] } [:need]
  require 'backports/tools/alias_method_chain'

  module Enumerable
    def to_h_with_block(*args, &block)
      return to_h_without_block(*args) unless block
      map(*args, &block).to_h_without_block
    end
    Backports.alias_method_chain self, :to_h, :block
  end
end

Version data entries

25 entries across 25 versions & 3 rubygems

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