Method: Configurable::Conversions#traverse
- Defined in:
- lib/configurable/conversions.rb
#traverse(nesting = [], &block) ⇒ Object
Yields each config in configs to the block with nesting, after appened self to nesting.
78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/configurable/conversions.rb', line 78 def traverse(nesting=[], &block) each_value do |config| if config.type.kind_of?(NestType) nesting.push config configs = config.type.configurable.class.configs configs.traverse(nesting, &block) nesting.pop else yield(nesting, config) end end end |