class Utils::ProbeServer::LogWrapper
probe server operations.
to log the changes, enabling tracking of environment modifications during
method calls to an underlying object (typically ENV) but intercepts assignments
environment variables while recording these interactions. It delegates all
This class provides a transparent interface for accessing and modifying
A wrapper class for environment variable management that logs operations.
def []=(name, value)
-
(String)
- the updated environment variable value returned by
Parameters:
-
value
(String
) -- the value to assign to the environment variable -
name
(String
) -- the environment variable key to set
def []=(name, value) name, value = name.to_s, value.to_s @server.output_message("Setting #{name}=#{value.inspect}.", type: :info) @object[name] = value end
def initialize(server, object)
-
object
(ENV
) -- the environment object to be wrapped -
server
(Utils::ProbeServer
) -- the probe server instance to be assigned
def initialize(server, object) @server, @object = server, object end
def method_missing(*a, &b)
-
(Object)
- the result of the delegated method call on the
Parameters:
-
b
(Proc
) -- the block passed to the missing method -
a
(Array
) -- the arguments passed to the missing method
def method_missing(*a, &b) @object.__send__(*a, &b) end