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

_tags(value) click to toggle source

@private

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

@private

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

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

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

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

Tags to apply to the rollback.

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

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

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

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

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

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