Sha256: 61790e60107c18accce701f790122f89b41551cd8ea904b75cfd922b6f2f12f1

Contents?: true

Size: 263 Bytes

Versions: 13

Compression:

Stored size: 263 Bytes

Contents

module DuckPuncher
  # @note When updating this file please update comment regarding this module in duck_puncher.rb
  module AncestralHash
    def ancestral_hash
      ::Hash.new { |me, klass| me[me.keys.detect { |key| key > klass }] if klass }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
duck_puncher-5.0.1 lib/duck_puncher/ancestral_hash.rb
duck_puncher-5.0.0 lib/duck_puncher/ancestral_hash.rb
duck_puncher-4.5.1 lib/duck_puncher/ancestral_hash.rb
duck_puncher-4.5.0 lib/duck_puncher/ancestral_hash.rb
duck_puncher-4.4.2 lib/duck_puncher/ancestral_hash.rb
duck_puncher-4.4.1 lib/duck_puncher/ancestral_hash.rb
duck_puncher-4.4.0 lib/duck_puncher/ancestral_hash.rb
duck_puncher-4.3.1 lib/duck_puncher/ancestral_hash.rb
duck_puncher-4.3.0 lib/duck_puncher/ancestral_hash.rb
duck_puncher-4.2.3 lib/duck_puncher/ancestral_hash.rb
duck_puncher-4.2.2 lib/duck_puncher/ancestral_hash.rb
duck_puncher-4.2.1 lib/duck_puncher/ancestral_hash.rb
duck_puncher-4.2.0 lib/duck_puncher/ancestral_hash.rb