class MediaWiktory::Wikipedia::Actions::Undelete
Restore revisions of a deleted page.
Usage:
“`ruby api.undelete.title(value).perform # returns string with raw output # or api.undelete.title(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/undelete.rb, line 73 def _fileids(value) merge(fileids: value.to_s, replace: false) end
@private
# File lib/mediawiktory/wikipedia/actions/undelete.rb, line 60 def _timestamps(value) merge(timestamps: value.iso8601, replace: false) end
@private
# File lib/mediawiktory/wikipedia/actions/undelete.rb, line 86 def _watchlist(value) defined?(super) && super || ["watch", "unwatch", "preferences", "nochange"].include?(value.to_s) && merge(watchlist: value.to_s) end
IDs of the file revisions to restore. If both timestamps and fileids are empty, all will be restored.
@param values [Array<Integer>] @return [self]
# File lib/mediawiktory/wikipedia/actions/undelete.rb, line 68 def fileids(*values) values.inject(self) { |res, val| res._fileids(val) } end
Reason for restoring.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/undelete.rb, line 34 def reason(value) merge(reason: value.to_s) end
Timestamps of the revisions to restore. If both timestamps and fileids are empty, all will be restored.
@param values [Array<Time>] @return [self]
# File lib/mediawiktory/wikipedia/actions/undelete.rb, line 55 def timestamps(*values) values.inject(self) { |res, val| res._timestamps(val) } end
Title of the page to restore.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/undelete.rb, line 26 def title(value) merge(title: value.to_s) end
A “csrf” token retrieved from action=query&meta=tokens
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/undelete.rb, line 94 def token(value) merge(token: value.to_s) end
Unconditionally add or remove the page from the current user's watchlist, use preferences or do not change watch.
@param value [String] One of “watch”, “unwatch”, “preferences”, “nochange”. @return [self]
# File lib/mediawiktory/wikipedia/actions/undelete.rb, line 81 def watchlist(value) _watchlist(value) or fail ArgumentError, "Unknown value for watchlist: #{value}" end