Sha256: 1d857b5f95542a4f77f8b59f9aeb27b1f28ab6edbcf6c6d0b8558927da8609b7

Contents?: true

Size: 129 Bytes

Versions: 17

Compression:

Stored size: 129 Bytes

Contents

unless Hash.method_defined? :to_proc
  class Hash
    def to_proc
      h = self
      proc {|*args| h[*args]}
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

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