Class: MediaWiktory::Wikipedia::Actions::Purge

Inherits:
Post
  • Object
show all
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

Methods inherited from Post

#perform

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.

Parameters:

  • value (String)

Returns:

  • (self)


40
41
42
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 40

def continue(value)
  merge(continue: value.to_s)
end

#converttitlesself

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.

Returns:

  • (self)


150
151
152
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 150

def converttitles()
  merge(converttitles: 'true')
end

#forcelinkupdateself

Update the links tables.

Returns:

  • (self)


25
26
27
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 25

def forcelinkupdate()
  merge(forcelinkupdate: 'true')
end

#forcerecursivelinkupdateself

Update the links table, and update the links tables for any page that uses this page as a template.

Returns:

  • (self)


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.

Parameters:

Returns:

  • (self)


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.

Parameters:

  • values (Array<Integer>)

Returns:

  • (self)


61
62
63
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 61

def pageids(*values)
  values.inject(self) { |res, val| res._pageids(val) }
end

#redirectsself

Automatically resolve redirects in titles, pageids, and revids, and in pages returned by generator.

Returns:

  • (self)


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.

Parameters:

  • values (Array<Integer>)

Returns:

  • (self)


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.

Parameters:

  • values (Array<String>)

Returns:

  • (self)


48
49
50
# File 'lib/mediawiktory/wikipedia/actions/purge.rb', line 48

def titles(*values)
  values.inject(self) { |res, val| res._titles(val) }
end