class Utils::ProbeClient::EnvProxy

during probe server operations.
It intercepts assignments and lookups to provide visibility into environment modifications
environment variables while logging these operations through the probe server.
This class provides a wrapper around the ENV object that allows setting and retrieving
A proxy class for managing environment variables through a probe server communication channel.

def [](key)

Returns:
  • (String) - the value of the specified environment variable

Parameters:
  • key (String) -- the environment variable key to retrieve
def [](key)
  response = @server.transmit_with_response(type: 'get_env', key:)
  response.env
end

def []=(key, value)

Returns:
  • (String) - the updated environment variable value returned by the server

Parameters:
  • value (String) -- the value to assign to the environment variable
  • key (String) -- the environment variable key to set
def []=(key, value)
  response = @server.transmit_with_response(type: 'set_env', key:, value:)
  response.env
end

def initialize(server)

Parameters:
  • server (UnixSocks::Server) -- the server object to be assigned
def initialize(server)
  @server = server
end