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
@private
# 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
@private
# File lib/mediawiktory/wikipedia/actions/revisiondelete.rb, line 52 def _ids(value) merge(ids: value.to_s, replace: false) end
@private
# 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
@private
# 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
@private
# 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
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
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 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
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
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
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
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 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