You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: settings.rb
    path of file: ./repos/anyway_config/lib/anyway
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require "pathname"

module Anyway
  # Use Settings name to not confuse with Config.
  #
  # Set
    
      def matching_env?(env)
        return true if env.nil? || env.to_s == current_environment

        if env.is_a?(::Hash)
          envs = env[:except]
          excluded_envs = [envs].flat_map(&:to_s)
          excluded_envs.none?(current_environment)
        elsif env.is_a?(::Array)
          env.flat_map(&:to_s).include?(current_environment)
        else
          false
        end