Sets the method of this Notificant.

        The notification method used for notification target.  # noqa: E501

        :param method: The method of this Notificant.  # noqa: E501
        :type: str
325446
def method(self, method):
        
        if method is None:
            raise ValueError("Invalid value for `method`, must not be `None`")  # noqa: E501
        allowed_values = ["WEBHOOK", "EMAIL", "PAGERDUTY"]  # noqa: E501
        if method not in allowed_values:
            raise ValueError(
                "Invalid value for `method` ({0}), must be one of {1}"  # noqa: E501
                .format(method, allowed_values)
            )

        self._method = method
210572
def dispatch(self, method_frame):
        '''
        
        '''
        method = self.dispatch_map.get(method_frame.method_id)
        if method:
            callback = self.channel.clear_synchronous_cb(method)
            callback(method_frame)
        else:
            raise self.InvalidMethod(
                "no method is registered with id: %d" % method_frame.method_id)
1063872
def method_missing(method, *args)
      if method.to_s.match /subscription/
        if args.size == 2
          @subscriptions.send method, args[0], args[1]
        else
          @subscriptions.send method, args[0]
        end
      else
        if method == :delivery_status || method == :retrieve_sms || method == :search_sms
          @reporting.send method, args[0]
        else
          raise RuntimeError, 'Unknown method'
        end
      end
    end
738978
public function setRequestMethod($method)
    {
        $this->requestMethod = $method === null ? self::DEFAULT_REQUEST_METHOD : strtoupper($method);
    }
355164
def method_call(receiver, message, args, pseudo_type=None):
    ''''''

    if not isinstance(receiver, Node):
        receiver = local(receiver)
    return Node('method_call', receiver=receiver, message=message, args=args, pseudo_type=pseudo_type)
26134
public Predictor method(int method, int startPage)
    {
        input.add(new CommandLine<>(METHOD, 5, method, startPage));
        return this;
    }
1336128
public void setMethod(WeightingMethod method, String fieldName) {
		WeightingMethod existingmethod = this.customWeights.get(fieldName);
		if (existingmethod == null) {
			this.customWeights.put(fieldName, method);
			return;
		}
		// already one specified : check that it is the same as the one we have
		if (!method.equals(existingmethod))
			throw new RuntimeException("Already set weight of field "
					+ fieldName + " to " + existingmethod.toString());
	}
442434
def _add_method_dunders(self, method):
        
        try:
            method.__module__ = self._cls.__module__
        except AttributeError:
            pass

        try:
            method.__qualname__ = ".".join(
                (self._cls.__qualname__, method.__name__)
            )
        except AttributeError:
            pass

        return method
545597
def method_missing(method, *args, &block)
      if @__receiver__.respond_to?(method.to_sym)
        @__receiver__.__send__(method.to_sym, *args, &block)
      else
        @__fallback__.__send__(method.to_sym, *args, &block)
      end
    end
911343
def method_missing(method_symbol, *args, &block)
      key = method_symbol.to_s
      set = key.chomp!('=')
      if set
        self[key] = args.first
      elsif self.key?(key)
        self[key]
      else
        nil
      end
    end
816675
def add_notification_method event, recipient_attribute, via
      mail_method = "#{event}_notification_to_#{recipient_attribute}"

      notification = "#{event}_#{recipient_attribute}".to_sym
      unless notifications_declared.include? notification
        notifications_declared << notification
      else
        raise "Notification for event '#{event}' to recipient '#{recipient_attribute}' already declared!"
      end

      # TODO only define notification method if method is present on mailer
      # TODO create task to generate / update mailer with notification settings

      define_method "#{event}" do |*args|
        returned = super *args if defined? super
        # TODO better error message when mailer is not found
        # TODO allow specification of custom mailer
        mailer = "#{self.class.name}Mailer".classify.constantize

        # TODO better error message when mail method is not found
        entity = send recipient_attribute
        mail   = mailer.send mail_method, self, entity

        mail.deliver or returned
      end
    end
1226109
def method_missing(method)
      method = method.to_s
      raise NoMethodError, "No such method: #{method}" unless @args.keys.include? method
      @args[method]
    end
435100
public function setMethod($method) {
        $methods = array(
            COMPLETION_AGGREGATION_ALL,
            COMPLETION_AGGREGATION_ANY,
        );

        if (in_array($method, $methods)) {
            $this->method = $method;
        } else {
            $this->method = COMPLETION_AGGREGATION_ALL;
        }
    }
997072
def send_notification(method, params)
      data = MessagePack.dump([2, method, params]).bytes
      ws.send(data)
    rescue => exc
      warn exc
      abort exc
    end
905422
def notify(self):
        
        if self.__method is not None:
            self.__method(self.__peer)
            return True
        return False
809639
public void setArguments(Method method) {

		Parameter[] parameters = method.getParameters();
		Class<?>[] parameterTypes = method.getParameterTypes();
		Annotation[][] annotations = method.getParameterAnnotations();

		async = isAsync(method.getReturnType());
		returnType = method.getReturnType();

		int index = 0;
		Map<String, MethodParameter> arguments = new HashMap<>();

		for (Annotation[] ann : annotations) {

			String name = null;
			ParameterType type = null;
			String defaultValue = null;
			boolean raw = false;
			Class<? extends ValueReader> valueReader = null;
			Class<? extends ContextProvider> contextValueProvider = null;

			for (Annotation annotation : ann) {

				if (annotation instanceof PathParam) {
					// find path param ... and set index ...
					name = ((PathParam) annotation).value();
					type = ParameterType.path;
				}

				if (annotation instanceof QueryParam) {
					// add param
					name = ((QueryParam) annotation).value();
					type = ParameterType.query;
				}

				if (annotation instanceof Raw) {
					raw = true;
				}

				if (annotation instanceof FormParam) {
					type = ParameterType.form;
					name = ((FormParam) annotation).value();
				}

				if (annotation instanceof CookieParam) {
					type = ParameterType.cookie;
					name = ((CookieParam) annotation).value();
				}

				if (annotation instanceof HeaderParam) {
					type = ParameterType.header;
					name = ((HeaderParam) annotation).value();
				}

				if (annotation instanceof MatrixParam) {
					type = ParameterType.matrix;
					name = ((MatrixParam) annotation).value();
				}

				if (annotation instanceof DefaultValue) {
					defaultValue = ((DefaultValue) annotation).value();
				}

				if (annotation instanceof RequestReader) {
					valueReader = ((RequestReader) annotation).value();
				}

				if (annotation instanceof ContextReader) {
					contextValueProvider = ((ContextReader) annotation).value();
				}

				if (annotation instanceof Context) {
					type = ParameterType.context;
					name = parameters[index].getName();
				}
			}

			// if no name provided than parameter is considered unknown (it might be request body, but we don't know)
			if (name == null) {

				// try to find out what parameter type it is ... POST, PUT have a body ...
				// regEx path might not have a name ...
				MethodParameter param = findParameter(index);
				if (param != null) {

					Assert.isNull(param.getDataType(), "Duplicate argument type given: " + parameters[index].getName());
					param.argument(parameterTypes[index], index); // set missing argument type and index
				} else {

					if (valueReader == null) {
						valueReader = reader; // take reader from method / class definition
					} else {
						reader = valueReader; // set body reader from field
					}

					name = parameters[index].getName();
					type = ParameterType.unknown;
				}
			}

			// collect only needed params for this method
			if (name != null) {

				// set context provider from method annotation if fitting
				if (contextValueProvider == null && contextProvider != null) {
					Type generic = ClassFactory.getGenericType(contextProvider);
				    if (ClassFactory.checkIfCompatibleTypes(parameterTypes[index], generic)) {
					    contextValueProvider = contextProvider;
				    }
				}

				MethodParameter parameter = provideArgument(name, type, defaultValue, raw, parameterTypes[index], valueReader, contextValueProvider, index);
				arguments.put(name, parameter);
			}

			index++;
		}

		setUsedArguments(arguments);
	}
854491
public function setDeclaringMethodId(
        $method_id,
        $declaring_method_id
    ) {
        list($fq_class_name, $method_name) = explode('::', $method_id);

        $class_storage = $this->classlike_storage_provider->get($fq_class_name);

        $class_storage->declaring_method_ids[$method_name] = $declaring_method_id;
    }