From 6e7c8237a70fd88e5a1b7ec92fd9c8277cc0f340 Mon Sep 17 00:00:00 2001 From: Daniel Asher Resnick Date: Thu, 23 Feb 2023 19:21:03 -0600 Subject: [PATCH] Define put_or_merge --- src/lib/data.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/data.rb b/src/lib/data.rb index 53d2dea..5b8fa56 100644 --- a/src/lib/data.rb +++ b/src/lib/data.rb @@ -45,6 +45,14 @@ module Charred end end + def put_or_merge(dict, key, value) + if(dict[key]) + verbose_merge dict[key], value + else + dict[key] = value + end + end + def lifepath_requirements(expr) if expr.is_a? Numeric []