From ed7f1fcd1e961a8a595fbc5d277e41024c134bd9 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Thu, 18 Nov 2021 15:13:19 -0800 Subject: [PATCH] Start adding Hash like methods to state bag --- plugins/commands/serve/client/state_bag.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/commands/serve/client/state_bag.rb b/plugins/commands/serve/client/state_bag.rb index 9ca6c5046..4fc077bcb 100644 --- a/plugins/commands/serve/client/state_bag.rb +++ b/plugins/commands/serve/client/state_bag.rb @@ -15,6 +15,7 @@ module VagrantPlugins ) client.get(req).value end + alias_method :[], :get # @param [String] # @return [String, Boolean] @@ -34,6 +35,7 @@ module VagrantPlugins ) client.put(req) end + alias_method :[]=, :put # @param [String] # @return [] @@ -43,6 +45,8 @@ module VagrantPlugins ) client.remove(req) end + alias_method :delete, :remove + end end end