380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
|
# File 'lib/cli.rb', line 380
def dereference_value(value, scope)
if value.is_a?(Hash) && value.length == 1 && Array(value.each_value)[0] == nil
result = scope
for name in Array(value.each_key)[0].split('.')
result = get_property(result, name)
end
value = result
elsif value.is_a?(Hash)
for key, item in value
value[key] = dereference_value(item, scope)
end
elsif value.is_a?(Array)
for item, index in value.each_with_index
value[index] = dereference_value(item, scope)
end
end
return value
end
|