Module: MediaWiktory::Wikipedia::Modules::Users
- Defined in:
- lib/mediawiktory/wikipedia/modules/users.rb
Overview
Get information about a list of users.
The "submodule" (MediaWiki API term) is included in action after setting some param, providing additional tweaking for this param. Example (for Actions::Query and its submodules):
api.query # returns Actions::Query
.prop(:revisions) # adds prop=revisions to action URL, and includes Modules::Revisions into action
.limit(10) # method of Modules::Revisions, adds rvlimit=10 to URL
All submodule's parameters are documented as its public methods, see below.
Instance Method Summary collapse
-
#attachedwiki(value) ⇒ self
With usprop=centralids, indicate whether the user is attached with the wiki identified by this ID.
-
#prop(*values) ⇒ self
Which pieces of information to include:.
-
#token(*values) ⇒ self
Use action=query&meta=tokens instead.
-
#userids(*values) ⇒ self
A list of user IDs to obtain information for.
-
#users(*values) ⇒ self
A list of users to obtain information for.
Instance Method Details
#attachedwiki(value) ⇒ self
With usprop=centralids, indicate whether the user is attached with the wiki identified by this ID.
38 39 40 |
# File 'lib/mediawiktory/wikipedia/modules/users.rb', line 38 def attachedwiki(value) merge(usattachedwiki: value.to_s) end |
#prop(*values) ⇒ self
Which pieces of information to include:
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/users.rb', line 25 def prop(*values) values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" } end |
#token(*values) ⇒ self
Use action=query&meta=tokens instead.
72 73 74 |
# File 'lib/mediawiktory/wikipedia/modules/users.rb', line 72 def token(*values) values.inject(self) { |res, val| res._token(val) or fail ArgumentError, "Unknown value for token: #{val}" } end |
#userids(*values) ⇒ self
A list of user IDs to obtain information for.
59 60 61 |
# File 'lib/mediawiktory/wikipedia/modules/users.rb', line 59 def userids(*values) values.inject(self) { |res, val| res._userids(val) } end |
#users(*values) ⇒ self
A list of users to obtain information for.
46 47 48 |
# File 'lib/mediawiktory/wikipedia/modules/users.rb', line 46 def users(*values) values.inject(self) { |res, val| res._users(val) } end |