require "thread"
require "active_support/core_ext/module/delegation"

module ClimateControl
  class Environment
    def initialize
      @semaphore = Mutex.new
    end

    delegate :[]=, :to_hash, :[], :delete, to: :env
    delegate :synchronize, to: :semaphore

    private

    attr_reader :semaphore

    def env
      ENV
    end
  end
end

require "thread"
require "forwardable"

module ClimateControl
  class Environment
    extend Forwardable

    def initialize
      @semaphore = Mutex.new
    end

    def_delegators :env, :[]=, :to_hash, :[], :delete
    def_delegator :@semaphore, :synchronize

    private

    def env
      ENV
    end
  end
end

Use stdlib Forwardable module instead of ActiveSupport delegation
Use stdlib Forwardable module instead of ActiveSupport delegation
