Class: MediaWiktory::Wikipedia::Actions::Globaluserrights
- Defined in:
- lib/mediawiktory/wikipedia/actions/globaluserrights.rb
Overview
Add/remove a user to/from global groups.
Usage:
api.globaluserrights.user(value).perform # returns string with raw output
# or
api.globaluserrights.user(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
-
#add(*values) ⇒ self
Add the user to these global groups.
-
#reason(value) ⇒ self
Reason for the change.
-
#remove(*values) ⇒ self
Remove the user from these global groups.
-
#tags(*values) ⇒ self
This parameter is currently unused.
-
#token(value) ⇒ self
A "userrights" token retrieved from action=query&meta=tokens.
-
#user(value) ⇒ self
Global user name.
-
#userid(value) ⇒ self
Global user ID.
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
#add(*values) ⇒ self
Add the user to these global groups.
42 43 44 |
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 42 def add(*values) values.inject(self) { |res, val| res._add(val) or fail ArgumentError, "Unknown value for add: #{val}" } end |
#reason(value) ⇒ self
Reason for the change.
68 69 70 |
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 68 def reason(value) merge(reason: value.to_s) end |
#remove(*values) ⇒ self
Remove the user from these global groups.
55 56 57 |
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 55 def remove(*values) values.inject(self) { |res, val| res._remove(val) or fail ArgumentError, "Unknown value for remove: #{val}" } end |
#tags(*values) ⇒ self
This parameter is currently unused.
84 85 86 |
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 84 def (*values) values.inject(self) { |res, val| res.(val) or fail ArgumentError, "Unknown value for tags: #{val}" } end |
#token(value) ⇒ self
A "userrights" token retrieved from action=query&meta=tokens
76 77 78 |
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 76 def token(value) merge(token: value.to_s) end |
#user(value) ⇒ self
Global user name.
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 26 def user(value) merge(user: value.to_s) end |
#userid(value) ⇒ self
Global user ID.
34 35 36 |
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 34 def userid(value) merge(userid: value.to_s) end |