Class: MediaWiktory::Wikipedia::Actions::Managetags
- Defined in:
- lib/mediawiktory/wikipedia/actions/managetags.rb
Overview
Perform management tasks relating to change tags.
Usage:
api..operation(value).perform # returns string with raw output
# or
api..operation(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
-
#ignorewarnings ⇒ self
Whether to ignore any warnings that are issued during the operation.
-
#operation(value) ⇒ self
Which operation to perform:.
-
#reason(value) ⇒ self
An optional reason for creating, deleting, activating or deactivating the tag.
-
#tag(value) ⇒ self
Tag to create, delete, activate or deactivate.
-
#tags(*values) ⇒ self
Change tags to apply to the entry in the tag management log.
-
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens.
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
#ignorewarnings ⇒ self
Whether to ignore any warnings that are issued during the operation.
54 55 56 |
# File 'lib/mediawiktory/wikipedia/actions/managetags.rb', line 54 def ignorewarnings() merge(ignorewarnings: 'true') end |
#operation(value) ⇒ self
Which operation to perform:
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/managetags.rb', line 26 def operation(value) _operation(value) or fail ArgumentError, "Unknown value for operation: #{value}" end |
#reason(value) ⇒ self
An optional reason for creating, deleting, activating or deactivating the tag.
47 48 49 |
# File 'lib/mediawiktory/wikipedia/actions/managetags.rb', line 47 def reason(value) merge(reason: value.to_s) end |
#tag(value) ⇒ self
Tag to create, delete, activate or deactivate. For tag creation, the tag must not exist. For tag deletion, the tag must exist. For tag activation, the tag must exist and not be in use by an extension. For tag deactivation, the tag must be currently active and manually defined.
39 40 41 |
# File 'lib/mediawiktory/wikipedia/actions/managetags.rb', line 39 def tag(value) merge(tag: value.to_s) end |
#tags(*values) ⇒ self
Change tags to apply to the entry in the tag management log.
62 63 64 |
# File 'lib/mediawiktory/wikipedia/actions/managetags.rb', line 62 def (*values) values.inject(self) { |res, val| res.(val) or fail ArgumentError, "Unknown value for tags: #{val}" } end |
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens
75 76 77 |
# File 'lib/mediawiktory/wikipedia/actions/managetags.rb', line 75 def token(value) merge(token: value.to_s) end |