Class: MediaWiktory::Wikipedia::Actions::Stabilize

Inherits:
Post
  • Object
show all
Defined in:
lib/mediawiktory/wikipedia/actions/stabilize.rb

Overview

Configure review-protection settings for a page.

Usage:

api.stabilize.protectlevel(value).perform # returns string with raw output
# or
api.stabilize.protectlevel(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

#expiry(value) ⇒ self

Review-protection expiry.

Parameters:

  • value (String)

Returns:

  • (self)


39
40
41
# File 'lib/mediawiktory/wikipedia/actions/stabilize.rb', line 39

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

#protectlevel(value) ⇒ self

The review-protection level.

Parameters:

  • value (String)

    One of "autoconfirmed", "none".

Returns:

  • (self)


26
27
28
# File 'lib/mediawiktory/wikipedia/actions/stabilize.rb', line 26

def protectlevel(value)
  _protectlevel(value) or fail ArgumentError, "Unknown value for protectlevel: #{value}"
end

#reason(value) ⇒ self

Reason.

Parameters:

  • value (String)

Returns:

  • (self)


47
48
49
# File 'lib/mediawiktory/wikipedia/actions/stabilize.rb', line 47

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

#title(value) ⇒ self

Title of the page to be review-protected.

Parameters:

  • value (String)

Returns:

  • (self)


71
72
73
# File 'lib/mediawiktory/wikipedia/actions/stabilize.rb', line 71

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

#token(value) ⇒ self

A "csrf" token retrieved from action=query&meta=tokens

Parameters:

  • value (String)

Returns:

  • (self)


63
64
65
# File 'lib/mediawiktory/wikipedia/actions/stabilize.rb', line 63

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

#watch(value) ⇒ self

Watch this page.

Parameters:

  • value (String)

Returns:

  • (self)


55
56
57
# File 'lib/mediawiktory/wikipedia/actions/stabilize.rb', line 55

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