Module: Babl::Operators::Dep
- Defined in:
- lib/babl/operators/dep.rb
Defined Under Namespace
Modules: DSL
Class Method Summary collapse
Class Method Details
.canonicalize(path) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/babl/operators/dep.rb', line 7 def self.canonicalize(path) case path when ::Array then path.reduce(Utils::Hash::EMPTY) { |a, p| a.merge(canonicalize(p)) } when ::Hash then path.map { |k, v| [k.dup.freeze, canonicalize(v)] }.to_h else { path.dup.freeze => Utils::Hash::EMPTY } end end |