Class: MediaWiktory::Wikipedia::Actions::Revisiondelete

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

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

#hide(*values) ⇒ self

What to hide for each revision.

Parameters:

  • values (Array<String>)

    Allowed values: "content", "comment", "user".

Returns:

  • (self)


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.

Parameters:

  • values (Array<String>)

Returns:

  • (self)


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.

Parameters:

  • value (String)

Returns:

  • (self)


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.

Parameters:

  • values (Array<String>)

    Allowed values: "content", "comment", "user".

Returns:

  • (self)


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.

Parameters:

  • value (String)

    One of "yes", "no", "nochange".

Returns:

  • (self)


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.

Parameters:

  • values (Array<String>)

    Allowed values: "ProveIt edit", "WPCleaner", "huggle", "large plot addition".

Returns:

  • (self)


107
108
109
# File 'lib/mediawiktory/wikipedia/actions/revisiondelete.rb', line 107

def tags(*values)
  values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, "Unknown value for tags: #{val}" }
end

#target(value) ⇒ self

Page title for the revision deletion, if required for the type.

Parameters:

  • value (String)

Returns:

  • (self)


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

Parameters:

  • value (String)

Returns:

  • (self)


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.

Parameters:

  • value (String)

    One of "revision", "archive", "oldimage", "filearchive", "logging".

Returns:

  • (self)


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