class MediaWiktory::Wikipedia::Actions::Delete
Delete
a page.
Usage:
“`ruby api.delete.title(value).perform # returns string with raw output # or api.delete.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/delete.rb, line 75 def _watchlist(value) defined?(super) && super || ["watch", "unwatch", "preferences", "nochange"].include?(value.to_s) && merge(watchlist: value.to_s) end
The name of the old image to delete as provided by action=query&prop=imageinfo&iiprop=archivename.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/delete.rb, line 90 def oldimage(value) merge(oldimage: value.to_s) end
Page ID of the page to delete. Cannot be used together with title.
@param value [Integer] @return [self]
# File lib/mediawiktory/wikipedia/actions/delete.rb, line 34 def pageid(value) merge(pageid: value.to_s) end
Reason for the deletion. If not set, an automatically generated reason will be used.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/delete.rb, line 42 def reason(value) merge(reason: value.to_s) end
Title of the page to delete. Cannot be used together with pageid.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/delete.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/delete.rb, line 98 def token(value) merge(token: value.to_s) end
Remove the page from the current user's watchlist.
@return [self]
# File lib/mediawiktory/wikipedia/actions/delete.rb, line 82 def unwatch() merge(unwatch: 'true') end
Add the page to the current user's watchlist.
@return [self]
# File lib/mediawiktory/wikipedia/actions/delete.rb, line 62 def watch() merge(watch: 'true') 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/delete.rb, line 70 def watchlist(value) _watchlist(value) or fail ArgumentError, "Unknown value for watchlist: #{value}" end