Class: MongoProfiler::Util
- Inherits:
-
Object
- Object
- MongoProfiler::Util
- Defined in:
- lib/mongo_profiler/util.rb
Class Method Summary collapse
Class Method Details
.deep_keys(hash) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/mongo_profiler/util.rb', line 4 def deep_keys(hash) return [] unless hash.is_a? Hash hash.inject([]) do |keys, (key, value)| keys << key case value when Hash keys.concat deep_keys(value) when Array value.each { |vvalue| keys.concat deep_keys(vvalue) } end keys end end |