Sha256: 6cde8870ae1f02b7ce16c2ab61080e27d26c06eb92155366cd080d8900536486

Contents?: true

Size: 520 Bytes

Versions: 31

Compression:

Stored size: 520 Bytes

Contents

class Hash
  # Standard in Ruby 1.8.8. See official documentation[http://ruby-doc.org/core-1.9/classes/Hash.html]
  class << self
    def try_convert(x)
      return nil unless x.respond_to? :to_hash
      x.to_hash
    end unless method_defined? :try_convert
  end

  # Standard in Ruby 1.9. See official documentation[http://ruby-doc.org/core-1.9/classes/Hash.html]
  def default_proc=(proc)
    replace(Hash.new(&Backports.coerce_to(proc, Proc, :to_proc)).merge!(self))
  end unless method_defined? :default_proc=
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
backports-2.3.0 lib/backports/1.9.1/hash.rb
backports-2.2.1 lib/backports/1.9.1/hash.rb
backports-2.2.0 lib/backports/1.9.1/hash.rb
backports-2.1.0 lib/backports/1.8.8/hash.rb
backports-2.0.3 lib/backports/1.8.8/hash.rb
backports-2.0.2 lib/backports/1.8.8/hash.rb
backports-2.0.1 lib/backports/1.8.8/hash.rb
backports-2.0.0 lib/backports/1.8.8/hash.rb
backports-1.18.2 lib/backports/1.8.8/hash.rb
backports-1.18.1 lib/backports/1.8.8/hash.rb
backports-1.18.0 lib/backports/1.8.8/hash.rb
backports-1.17.1 lib/backports/1.8.8/hash.rb
backports-1.17.0 lib/backports/1.8.8/hash.rb
backports-1.16.7 lib/backports/1.8.8/hash.rb
backports-1.16.6 lib/backports/1.8.8/hash.rb
backports-1.16.5 lib/backports/1.8.8/hash.rb
backports-1.16.4 lib/backports/1.8.8/hash.rb
backports-1.16.3 lib/backports/1.8.8/hash.rb
backports-1.16.2 lib/backports/1.8.8/hash.rb
backports-1.16.1 lib/backports/1.8.8/hash.rb