Class: MediaWiktory::Wikipedia::Actions::Undelete
- Defined in:
- lib/mediawiktory/wikipedia/actions/undelete.rb
Overview
Restore revisions of a deleted page.
Usage:
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 Response for working with action responses.
All action's parameters are documented as its public methods, see below.
Instance Method Summary collapse
-
#fileids(*values) ⇒ self
IDs of the file revisions to restore.
-
#reason(value) ⇒ self
Reason for restoring.
-
#tags(*values) ⇒ self
Change tags to apply to the entry in the deletion log.
-
#timestamps(*values) ⇒ self
Timestamps of the revisions to restore.
-
#title(value) ⇒ self
Title of the page to restore.
-
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens.
-
#watchlist(value) ⇒ self
Unconditionally add or remove the page from the current user's watchlist, use preferences or do not change watch.
Methods inherited from Post
Methods inherited from Base
#inspect, #merge, #name, #perform, #response, #to_h, #to_param, #to_url
Methods included from GlobalParams
#assert, #assertuser, #centralauthtoken, #curtimestamp, #errorformat, #errorlang, #errorsuselocal, #format, #maxage, #maxlag, #origin, #requestid, #responselanginfo, #servedby, #smaxage, #uselang
Instance Method Details
#fileids(*values) ⇒ self
IDs of the file revisions to restore. If both timestamps and fileids are empty, all will be restored.
68 69 70 |
# File 'lib/mediawiktory/wikipedia/actions/undelete.rb', line 68 def fileids(*values) values.inject(self) { |res, val| res._fileids(val) } end |
#reason(value) ⇒ self
Reason for restoring.
34 35 36 |
# File 'lib/mediawiktory/wikipedia/actions/undelete.rb', line 34 def reason(value) merge(reason: value.to_s) end |
#tags(*values) ⇒ self
Change tags to apply to the entry in the deletion log.
42 43 44 |
# File 'lib/mediawiktory/wikipedia/actions/undelete.rb', line 42 def (*values) values.inject(self) { |res, val| res.(val) or fail ArgumentError, "Unknown value for tags: #{val}" } end |
#timestamps(*values) ⇒ self
Timestamps of the revisions to restore. If both timestamps and fileids are empty, all will be restored.
55 56 57 |
# File 'lib/mediawiktory/wikipedia/actions/undelete.rb', line 55 def (*values) values.inject(self) { |res, val| res.(val) } end |
#title(value) ⇒ self
Title of the page to restore.
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/undelete.rb', line 26 def title(value) merge(title: value.to_s) end |
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens
94 95 96 |
# File 'lib/mediawiktory/wikipedia/actions/undelete.rb', line 94 def token(value) merge(token: value.to_s) end |
#watchlist(value) ⇒ self
Unconditionally add or remove the page from the current user's watchlist, use preferences or do not change watch.
81 82 83 |
# File 'lib/mediawiktory/wikipedia/actions/undelete.rb', line 81 def watchlist(value) _watchlist(value) or fail ArgumentError, "Unknown value for watchlist: #{value}" end |