class MediaWiktory::Wikipedia::Actions::Tag
Add or remove change tags from individual revisions or log entries.
Usage:
“`ruby api.tag.rcid(value).perform # returns string with raw output # or api.tag.rcid(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
@private
# File lib/mediawiktory/wikipedia/actions/tag.rb, line 70 def _add(value) defined?(super) && super || ["ProveIt edit", "WPCleaner", "huggle", "large plot addition"].include?(value.to_s) && merge(add: value.to_s, replace: false) end
@private
# File lib/mediawiktory/wikipedia/actions/tag.rb, line 57 def _logid(value) merge(logid: value.to_s, replace: false) end
@private
# File lib/mediawiktory/wikipedia/actions/tag.rb, line 31 def _rcid(value) merge(rcid: value.to_s, replace: false) end
@private
# File lib/mediawiktory/wikipedia/actions/tag.rb, line 83 def _remove(value) merge(remove: value.to_s, replace: false) end
@private
# File lib/mediawiktory/wikipedia/actions/tag.rb, line 44 def _revid(value) merge(revid: value.to_s, replace: false) end
Tags to add. Only manually defined tags can be added.
@param values [Array<String>] Allowed values: “ProveIt edit”, “WPCleaner”, “huggle”, “large plot addition”. @return [self]
# File lib/mediawiktory/wikipedia/actions/tag.rb, line 65 def add(*values) values.inject(self) { |res, val| res._add(val) or fail ArgumentError, "Unknown value for add: #{val}" } end
One or more log entry IDs from which to add or remove the tag.
@param values [Array<Integer>] @return [self]
# File lib/mediawiktory/wikipedia/actions/tag.rb, line 52 def logid(*values) values.inject(self) { |res, val| res._logid(val) } end
One or more recent changes IDs from which to add or remove the tag.
@param values [Array<Integer>] @return [self]
# File lib/mediawiktory/wikipedia/actions/tag.rb, line 26 def rcid(*values) values.inject(self) { |res, val| res._rcid(val) } end
Reason for the change.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/tag.rb, line 91 def reason(value) merge(reason: value.to_s) end
Tags to remove. Only tags that are either manually defined or completely undefined can be removed.
@param values [Array<String>] @return [self]
# File lib/mediawiktory/wikipedia/actions/tag.rb, line 78 def remove(*values) values.inject(self) { |res, val| res._remove(val) } end
One or more revision IDs from which to add or remove the tag.
@param values [Array<Integer>] @return [self]
# File lib/mediawiktory/wikipedia/actions/tag.rb, line 39 def revid(*values) values.inject(self) { |res, val| res._revid(val) } end
A “csrf” token retrieved from action=query&meta=tokens
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/tag.rb, line 112 def token(value) merge(token: value.to_s) end