Sha256: 674e54adb6325908f6f5ca7e78b32b2cdefaa5079386e5d7022410a75cc63092
Contents?: true
Size: 321 Bytes
Versions: 11
Compression:
Stored size: 321 Bytes
Contents
unless Struct.method_defined? :dig class Struct def dig(key, *rest) return nil unless respond_to?(key) val = public_send(key) return val if rest.empty? || val == nil raise TypeError, "#{val.class} does not have #dig method" unless val.respond_to? :dig val.dig(*rest) end end end
Version data entries
11 entries across 11 versions & 1 rubygems