module RackRequestIPStrategies
  class Base
    def self.call(env, config = Config.default)
      new(env, config).call
    end

    def initialize(env, config)
      @env = env
      @config = config
    end

    private

    def ips_from(header)
      ips = @env[header] ? @env[header].strip.split(/[,\s]+/) : []
      ips.select { |ip| valid_ip?(ip) }
    end

    def valid_ip?(ip)
      return false if ip.include?('/')
      IPAddr.new(ip)
    rescue ArgumentError, IPAddr::InvalidAddressError
      nil
    end
  end
end

module RackRequestIPStrategies
  class Base
    def self.call(env, config = Config.default)
      new(env, config).call
    end

    def initialize(env, config)
      @env = env
      @config = config
    end

    private

    def ips_from(header)
      ips = @env[header] ? @env[header].strip.split(/[,\s]+/) : []
      ips.select { |ip| valid_ip?(ip) }
    end

    def valid_ip?(ip)
      return false if ip.include?('/')
      IPAddr.new(ip)
    rescue ArgumentError, IPAddr::InvalidAddressError
      false
    end
  end
end

Use false to be consistent with the early return
Use false to be consistent with the early return