Class: MediaWiktory::Wikipedia::Actions::Stabilize
- 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
-
#expiry(value) ⇒ self
Review-protection expiry.
-
#protectlevel(value) ⇒ self
The review-protection level.
-
#reason(value) ⇒ self
Reason.
-
#title(value) ⇒ self
Title of the page to be review-protected.
-
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens.
-
#watch(value) ⇒ self
Watch this page.
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
#expiry(value) ⇒ self
Review-protection expiry.
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.
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.
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.
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
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.
55 56 57 |
# File 'lib/mediawiktory/wikipedia/actions/stabilize.rb', line 55 def watch(value) merge(watch: value.to_s) end |