Sha256: 0b28928fff235657dd96584cef81b7d2a70118e43b1f5cdffdcb807b30d40d7a
Contents?: true
Size: 289 Bytes
Versions: 7
Compression:
Stored size: 289 Bytes
Contents
# frozen_string_literal: true class Hash def deep_find(key, object = self, found = nil) return object[key] if object.respond_to?(:key?) && object.key?(key) return found unless object.is_a?(Enumerable) object.find { |*a| found = deep_find(key, a.last) } found end end
Version data entries
7 entries across 7 versions & 2 rubygems