class MediaWiktory::Wikipedia::Actions::Rollback
Undo the last edit to the page.
Usage:
“`ruby api.rollback.title(value).perform # returns string with raw output # or api.rollback.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/rollback.rb, line 83 def _watchlist(value) defined?(super) && super || ["watch", "unwatch", "preferences", "nochange"].include?(value.to_s) && merge(watchlist: value.to_s) end
Mark the reverted edits and the revert as bot edits.
@return [self]
# File lib/mediawiktory/wikipedia/actions/rollback.rb, line 70 def markbot() merge(markbot: 'true') end
Page ID of the page to roll back. Cannot be used together with title.
@param value [Integer] @return [self]
# File lib/mediawiktory/wikipedia/actions/rollback.rb, line 34 def pageid(value) merge(pageid: value.to_s) end
Custom edit summary. If empty, default summary will be used.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/rollback.rb, line 63 def summary(value) merge(summary: value.to_s) end
Title of the page to roll back. Cannot be used together with pageid.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/rollback.rb, line 26 def title(value) merge(title: value.to_s) end
A “rollback” token retrieved from action=query&meta=tokens
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/rollback.rb, line 91 def token(value) merge(token: value.to_s) end
Name of the user whose edits are to be rolled back.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/rollback.rb, line 55 def user(value) merge(user: 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/rollback.rb, line 78 def watchlist(value) _watchlist(value) or fail ArgumentError, "Unknown value for watchlist: #{value}" end