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

_add(value) click to toggle source

@private

Calls superclass method
# 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
_logid(value) click to toggle source

@private

# File lib/mediawiktory/wikipedia/actions/tag.rb, line 57
def _logid(value)
  merge(logid: value.to_s, replace: false)
end
_rcid(value) click to toggle source

@private

# File lib/mediawiktory/wikipedia/actions/tag.rb, line 31
def _rcid(value)
  merge(rcid: value.to_s, replace: false)
end
_remove(value) click to toggle source

@private

# File lib/mediawiktory/wikipedia/actions/tag.rb, line 83
def _remove(value)
  merge(remove: value.to_s, replace: false)
end
_revid(value) click to toggle source

@private

# File lib/mediawiktory/wikipedia/actions/tag.rb, line 44
def _revid(value)
  merge(revid: value.to_s, replace: false)
end
_tags(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/tag.rb, line 104
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
add(*values) click to toggle source

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
logid(*values) click to toggle source

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
rcid(*values) click to toggle source

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(value) click to toggle source

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
remove(*values) click to toggle source

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
revid(*values) click to toggle source

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
tags(*values) click to toggle source

Tags to apply to the log entry that will be created as a result of this action.

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

# File lib/mediawiktory/wikipedia/actions/tag.rb, line 99
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/tag.rb, line 112
def token(value)
  merge(token: value.to_s)
end