Sha256: aa9f92c18b9679abed4f429c7109543d0d04cdae148dad86efc81b14f4730844

Contents?: true

Size: 370 Bytes

Versions: 4

Compression:

Stored size: 370 Bytes

Contents

module WhoAmI
  module Refinement
    module HashDig
      refine Hash do
        if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.3.0")
          def dig(head, *tail)
            if tail.empty? || !self.key?(head)
              self[head]
            else
              self[head].dig(*tail)
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
who_am_i-0.0.6 lib/who_am_i/refinement/hash_dig.rb
who_am_i-0.0.5 lib/who_am_i/refinement/hash_dig.rb
who_am_i-0.0.4 lib/who_am_i/refinement/hash_dig.rb
who_am_i-0.0.3 lib/who_am_i/refinement/hash_dig.rb