class MediaWiktory::Wikipedia::Actions::Managetags

Perform management tasks relating to change tags.

Usage:

“`ruby api.managetags.operation(value).perform # returns string with raw output # or api.managetags.operation(value).response # returns output parsed and wrapped into Response object “`

See {Base} for generic explanation of working with MediaWiki actions and {MediaWiktory::Wikipedia::Response} for working with action responses.

All action's parameters are documented as its public methods, see below.

Public Instance Methods

_operation(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/managetags.rb, line 31
def _operation(value)
  defined?(super) && super || ["create", "delete", "activate", "deactivate"].include?(value.to_s) && merge(operation: value.to_s)
end
_tags(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/managetags.rb, line 67
def _tags(value)
  defined?(super) && super || ["ProveIt edit", "WPCleaner", "huggle", "large plot addition"].include?(value.to_s) && merge(tags: value.to_s, replace: false)
end
ignorewarnings() click to toggle source

Whether to ignore any warnings that are issued during the operation.

@return [self]

# File lib/mediawiktory/wikipedia/actions/managetags.rb, line 54
def ignorewarnings()
  merge(ignorewarnings: 'true')
end
operation(value) click to toggle source

Which operation to perform:

@param value [String] One of “create” (Create a new change tag for manual use), “delete” (Remove a change tag from the database, including removing the tag from all revisions, recent change entries and log entries on which it is used), “activate” (Activate a change tag, allowing users to apply it manually), “deactivate” (Deactivate a change tag, preventing users from applying it manually). @return [self]

# File lib/mediawiktory/wikipedia/actions/managetags.rb, line 26
def operation(value)
  _operation(value) or fail ArgumentError, "Unknown value for operation: #{value}"
end
reason(value) click to toggle source

An optional reason for creating, deleting, activating or deactivating the tag.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/managetags.rb, line 47
def reason(value)
  merge(reason: value.to_s)
end
tag(value) click to toggle source

Tag to create, delete, activate or deactivate. For tag creation, the tag must not exist. For tag deletion, the tag must exist. For tag activation, the tag must exist and not be in use by an extension. For tag deactivation, the tag must be currently active and manually defined.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/managetags.rb, line 39
def tag(value)
  merge(tag: value.to_s)
end
tags(*values) click to toggle source

Change tags to apply to the entry in the tag management log.

@param values [Array<String>] Allowed values: “ProveIt edit”, “WPCleaner”, “huggle”, “large plot addition”. @return [self]

# File lib/mediawiktory/wikipedia/actions/managetags.rb, line 62
def tags(*values)
  values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, "Unknown value for tags: #{val}" }
end
token(value) click to toggle source

A “csrf” token retrieved from action=query&meta=tokens

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/managetags.rb, line 75
def token(value)
  merge(token: value.to_s)
end