# File lib/activeldap/base.rb, line 822
    def method_missing(name, *args)
      @@logger.debug("stub: called method_missing(#{name.inspect}, #{args.inspect})")

      # dynamically update the available attributes without requiring an
      # explicit call. The cache 'last_oc' saves a lot of cpu time.
      if @data['objectClass'] != @last_oc
        @@logger.debug("method_missing(#{name.inspect}, #{args.inspect}): updating apply_objectclass(#{@data['objectClass'].inspect})")
        send(:apply_objectclass, @data['objectClass'])
      end
      key = name.to_s
      case key
        when /^(\S+)=$/
          real_key = $1
          @@logger.debug("method_missing: attr_methods has_key? #{real_key}")
          if @attr_methods.has_key? real_key
            raise ArgumentError, "wrong number of arguments (#{args.size} for 1)" if args.size != 1
            @@logger.debug("method_missing: calling :attribute_method=(#{real_key}, #{args[0]})")
            return send(:attribute_method=, real_key, args[0])
          end
        else
          @@logger.debug("method_missing: attr_methods has_key? #{key}")
          if @attr_methods.has_key? key
            raise ArgumentError, "wrong number of arguments (#{args.size} for 1)" if args.size > 1
            return attribute_method(key, *args)
          end
      end
      raise NoMethodError, "undefined method `#{key}' for #{self}"
    end