class MediaWiktory::Wikipedia::Actions::Revisiondelete

Delete and undelete revisions.

Usage:

“`ruby api.revisiondelete.type(value).perform # returns string with raw output # or api.revisiondelete.type(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

_hide(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 65
def _hide(value)
  defined?(super) && super || ["content", "comment", "user"].include?(value.to_s) && merge(hide: value.to_s, replace: false)
end
_ids(value) click to toggle source

@private

# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 52
def _ids(value)
  merge(ids: value.to_s, replace: false)
end
_show(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 78
def _show(value)
  defined?(super) && super || ["content", "comment", "user"].include?(value.to_s) && merge(show: value.to_s, replace: false)
end
_suppress(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 91
def _suppress(value)
  defined?(super) && super || ["yes", "no", "nochange"].include?(value.to_s) && merge(suppress: value.to_s)
end
_tags(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 112
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
_type(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 31
def _type(value)
  defined?(super) && super || ["revision", "archive", "oldimage", "filearchive", "logging"].include?(value.to_s) && merge(type: value.to_s)
end
hide(*values) click to toggle source

What to hide for each revision.

@param values [Array<String>] Allowed values: “content”, “comment”, “user”. @return [self]

# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 60
def hide(*values)
  values.inject(self) { |res, val| res._hide(val) or fail ArgumentError, "Unknown value for hide: #{val}" }
end
ids(*values) click to toggle source

Identifiers for the revisions to be deleted.

@param values [Array<String>] @return [self]

# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 47
def ids(*values)
  values.inject(self) { |res, val| res._ids(val) }
end
reason(value) click to toggle source

Reason for the deletion or undeletion.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 99
def reason(value)
  merge(reason: value.to_s)
end
show(*values) click to toggle source

What to unhide for each revision.

@param values [Array<String>] Allowed values: “content”, “comment”, “user”. @return [self]

# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 73
def show(*values)
  values.inject(self) { |res, val| res._show(val) or fail ArgumentError, "Unknown value for show: #{val}" }
end
suppress(value) click to toggle source

Whether to suppress data from administrators as well as others.

@param value [String] One of “yes”, “no”, “nochange”. @return [self]

# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 86
def suppress(value)
  _suppress(value) or fail ArgumentError, "Unknown value for suppress: #{value}"
end
tags(*values) click to toggle source

Tags to apply to the entry in the deletion log.

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

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

Page title for the revision deletion, if required for the type.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 39
def target(value)
  merge(target: value.to_s)
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/revisiondelete.rb, line 120
def token(value)
  merge(token: value.to_s)
end
type(value) click to toggle source

Type of revision deletion being performed.

@param value [String] One of “revision”, “archive”, “oldimage”, “filearchive”, “logging”. @return [self]

# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 26
def type(value)
  _type(value) or fail ArgumentError, "Unknown value for type: #{value}"
end