Class: MediaWiktory::Wikipedia::Actions::Revisiondelete
- Defined in:
- lib/mediawiktory/wikipedia/actions/revisiondelete.rb
Overview
Delete and undelete revisions.
Usage:
api.revisiondelete.type(value).perform # returns string with raw output
# or
api.revisiondelete.type(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
-
#hide(*values) ⇒ self
What to hide for each revision.
-
#ids(*values) ⇒ self
Identifiers for the revisions to be deleted.
-
#reason(value) ⇒ self
Reason for the deletion or undeletion.
-
#show(*values) ⇒ self
What to unhide for each revision.
-
#suppress(value) ⇒ self
Whether to suppress data from administrators as well as others.
-
#tags(*values) ⇒ self
Tags to apply to the entry in the deletion log.
-
#target(value) ⇒ self
Page title for the revision deletion, if required for the type.
-
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens.
-
#type(value) ⇒ self
Type of revision deletion being performed.
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
#hide(*values) ⇒ self
What to hide for each revision.
60 61 62 |
# File 'lib/mediawiktory/wikipedia/actions/revisiondelete.rb', line 60 def hide(*values) values.inject(self) { |res, val| res._hide(val) or fail ArgumentError, "Unknown value for hide: #{val}" } end |
#ids(*values) ⇒ self
Identifiers for the revisions to be deleted.
47 48 49 |
# File 'lib/mediawiktory/wikipedia/actions/revisiondelete.rb', line 47 def ids(*values) values.inject(self) { |res, val| res._ids(val) } end |
#reason(value) ⇒ self
Reason for the deletion or undeletion.
99 100 101 |
# File 'lib/mediawiktory/wikipedia/actions/revisiondelete.rb', line 99 def reason(value) merge(reason: value.to_s) end |
#show(*values) ⇒ self
What to unhide for each revision.
73 74 75 |
# File 'lib/mediawiktory/wikipedia/actions/revisiondelete.rb', line 73 def show(*values) values.inject(self) { |res, val| res._show(val) or fail ArgumentError, "Unknown value for show: #{val}" } end |
#suppress(value) ⇒ self
Whether to suppress data from administrators as well as others.
86 87 88 |
# File 'lib/mediawiktory/wikipedia/actions/revisiondelete.rb', line 86 def suppress(value) _suppress(value) or fail ArgumentError, "Unknown value for suppress: #{value}" end |
#tags(*values) ⇒ self
Tags to apply to the entry in the deletion log.
107 108 109 |
# File 'lib/mediawiktory/wikipedia/actions/revisiondelete.rb', line 107 def (*values) values.inject(self) { |res, val| res.(val) or fail ArgumentError, "Unknown value for tags: #{val}" } end |
#target(value) ⇒ self
Page title for the revision deletion, if required for the type.
39 40 41 |
# File 'lib/mediawiktory/wikipedia/actions/revisiondelete.rb', line 39 def target(value) merge(target: value.to_s) end |
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens
120 121 122 |
# File 'lib/mediawiktory/wikipedia/actions/revisiondelete.rb', line 120 def token(value) merge(token: value.to_s) end |
#type(value) ⇒ self
Type of revision deletion being performed.
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/revisiondelete.rb', line 26 def type(value) _type(value) or fail ArgumentError, "Unknown value for type: #{value}" end |