diff --git a/lib/rupkl/node/pkl_object.rb b/lib/rupkl/node/pkl_object.rb index 6be99ac..3a9f252 100644 --- a/lib/rupkl/node/pkl_object.rb +++ b/lib/rupkl/node/pkl_object.rb @@ -10,11 +10,7 @@ def evaluate_property(value, objects, scopes) end def property_to_ruby(value, objects, scopes) - if value - value.to_ruby(scopes) - else - evaluate_objects(objects, scopes).to_ruby(nil) - end + evaluate_property(value, objects, scopes).to_ruby(nil) end def evaluate_objects(objects, scopes) diff --git a/spec/rupkl/node/pkl_object_spec.rb b/spec/rupkl/node/pkl_object_spec.rb index 4889e2d..a1c1cbc 100644 --- a/spec/rupkl/node/pkl_object_spec.rb +++ b/spec/rupkl/node/pkl_object_spec.rb @@ -427,7 +427,7 @@ #{pkl} c = a == b PKL - node.evaluate(nil) do |n| + node.evaluate(nil).then do |n| expect(n.properties[-1].value).to be_boolean(true) end @@ -435,7 +435,7 @@ #{pkl} c = a != b PKL - node.evaluate(nil) do |n| + node.evaluate(nil).then do |n| expect(n.properties[-1].value).to be_boolean(false) end end @@ -445,7 +445,7 @@ #{pkl} c = a == b PKL - node.evaluate(nil) do |n| + node.evaluate(nil).then do |n| expect(n.properties[-1].value).to be_boolean(false) end @@ -453,7 +453,7 @@ #{pkl} c = a != b PKL - node.evaluate(nil) do |n| + node.evaluate(nil).then do |n| expect(n.properties[-1].value).to be_boolean(true) end end