25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/coaster/core_ext/deep_key_count.rb', line 25
def deep_key_count(**options)
sum do |v|
case v
when Hash
v.deep_key_count(**options)
when Array
if options[:array_is_element]
1
else
v.deep_key_count(**options)
end
else
1
end
end
end
|