13: def evaluate(scope)
14: level = scope.ephemeral_level
15:
16: value = @test.safeevaluate(scope)
17:
18: retvalue = nil
19: found = false
20:
21:
22: default = nil
23: @options.each do |option|
24: option.eachopt do |opt|
25: return option.safeevaluate(scope) if opt.evaluate_match(value, scope)
26: end
27:
28: default = option if option.default?
29: end
30:
31:
32: return default.safeevaluate(scope) if default
33:
34: Puppet.debug "No true answers and no default"
35: return nil
36: ensure
37: scope.unset_ephemeral_var(level)
38: end