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-1.15.0 lib/backports/1.8.8/hash.rb
backports-1.14.1 lib/backports/1.8.8/hash.rb
backports-1.14.0 lib/backports/1.8.8/hash.rb
backports-1.13.3 lib/backports/1.8.8/hash.rb
backports-1.13.2 lib/backports/1.8.8/hash.rb
backports-1.13.1 lib/backports/1.8.8/hash.rb
backports-1.13.0 lib/backports/1.8.8/hash.rb
backports-1.12.3 lib/backports/1.8.8/hash.rb
backports-1.12.2 lib/backports/1.8.8/hash.rb
backports-1.12.1 lib/backports/1.8.8/hash.rb
backports-1.12.0 lib/backports/1.8.8/hash.rb