Class: MediaWiktory::Wikipedia::Actions::Purge
- Defined in:
- lib/mediawiktory/wikipedia/actions/purge.rb
Overview
Purge the cache for the given titles.
Usage:
api.purge.forcelinkupdate(value).perform # returns string with raw output
# or
api.purge.forcelinkupdate(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
-
#continue(value) ⇒ self
When more results are available, use this to continue.
-
#converttitles ⇒ self
Convert titles to other variants if necessary.
-
#forcelinkupdate ⇒ self
Update the links tables.
-
#forcerecursivelinkupdate ⇒ self
Update the links table, and update the links tables for any page that uses this page as a template.
-
#generator(value) ⇒ self
Get the list of pages to work on by executing the specified query module.
-
#pageids(*values) ⇒ self
A list of page IDs to work on.
-
#redirects ⇒ self
Automatically resolve redirects in titles, pageids, and revids, and in pages returned by generator.
-
#revids(*values) ⇒ self
A list of revision IDs to work on.
-
#titles(*values) ⇒ self
A list of titles to work on.
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
#continue(value) ⇒ self
When more results are available, use this to continue.
40 41 42 |
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 40 def continue(value) merge(continue: value.to_s) end |
#converttitles ⇒ self
Convert titles to other variants if necessary. Only works if the wiki's content language supports variant conversion. Languages that support variant conversion include gan, iu, kk, ku, shi, sr, tg, uz and zh.
150 151 152 |
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 150 def converttitles() merge(converttitles: 'true') end |
#forcelinkupdate ⇒ self
Update the links tables.
25 26 27 |
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 25 def forcelinkupdate() merge(forcelinkupdate: 'true') end |
#forcerecursivelinkupdate ⇒ self
Update the links table, and update the links tables for any page that uses this page as a template.
32 33 34 |
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 32 def forcerecursivelinkupdate() merge(forcerecursivelinkupdate: 'true') end |
#generator(value) ⇒ self
Get the list of pages to work on by executing the specified query module.
131 132 133 |
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 131 def generator(value) _generator(value) or fail ArgumentError, "Unknown value for generator: #{value}" end |
#pageids(*values) ⇒ self
A list of page IDs to work on.
61 62 63 |
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 61 def pageids(*values) values.inject(self) { |res, val| res._pageids(val) } end |
#redirects ⇒ self
Automatically resolve redirects in titles, pageids, and revids, and in pages returned by generator.
143 144 145 |
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 143 def redirects() merge(redirects: 'true') end |
#revids(*values) ⇒ self
A list of revision IDs to work on.
74 75 76 |
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 74 def revids(*values) values.inject(self) { |res, val| res._revids(val) } end |
#titles(*values) ⇒ self
A list of titles to work on.
48 49 50 |
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 48 def titles(*values) values.inject(self) { |res, val| res._titles(val) } end |