diff --git a/lib/builder.rb b/lib/builder.rb index b6f1c8c8..1a9bbc7c 100644 --- a/lib/builder.rb +++ b/lib/builder.rb @@ -53,7 +53,13 @@ class CustomWizard::Builder result end - result = result.gsub(/w\{(.*?)\}/) { |match| data[$1.to_sym] } + result.gsub(/w\{(.*?)\}/) { |match| recurse(data, [*$1.split('.')]) } + end + + def self.recurse(data, keys) + k = keys.shift + result = data[k] + keys.empty? ? result : self.recurse(result, keys) end def build(build_opts = {}, params = {})