Module: MediaWiktory::Wikipedia::Modules::Allusers
- Defined in:
- lib/mediawiktory/wikipedia/modules/allusers.rb
Overview
Enumerate all registered 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
-
#activeusers ⇒ self
Only list users active in the last 30 days.
-
#attachedwiki(value) ⇒ self
With auprop=centralids, also indicate whether the user is attached with the wiki identified by this ID.
-
#dir(value) ⇒ self
Direction to sort in.
-
#excludegroup(*values) ⇒ self
Exclude users in the given groups.
-
#from(value) ⇒ self
The user name to start enumerating from.
-
#group(*values) ⇒ self
Only include users in the given groups.
-
#limit(value) ⇒ self
How many total user names to return.
-
#prefix(value) ⇒ self
Search for all users that begin with this value.
-
#prop(*values) ⇒ self
Which pieces of information to include:.
-
#rights(*values) ⇒ self
Only include users with the given rights.
-
#to(value) ⇒ self
The user name to stop enumerating at.
-
#witheditsonly ⇒ self
Only list users who have made edits.
Instance Method Details
#activeusers ⇒ self
Only list users active in the last 30 days.
128 129 130 |
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 128 def activeusers() merge(auactiveusers: 'true') end |
#attachedwiki(value) ⇒ self
With auprop=centralids, also indicate whether the user is attached with the wiki identified by this ID.
136 137 138 |
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 136 def attachedwiki(value) merge(auattachedwiki: value.to_s) end |
#dir(value) ⇒ self
Direction to sort in.
49 50 51 |
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 49 def dir(value) _dir(value) or fail ArgumentError, "Unknown value for dir: #{value}" end |
#excludegroup(*values) ⇒ self
Exclude users in the given groups.
75 76 77 |
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 75 def excludegroup(*values) values.inject(self) { |res, val| res._excludegroup(val) or fail ArgumentError, "Unknown value for excludegroup: #{val}" } end |
#from(value) ⇒ self
The user name to start enumerating from.
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 25 def from(value) merge(aufrom: value.to_s) end |
#group(*values) ⇒ self
Only include users in the given groups.
62 63 64 |
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 62 def group(*values) values.inject(self) { |res, val| res._group(val) or fail ArgumentError, "Unknown value for group: #{val}" } end |
#limit(value) ⇒ self
How many total user names to return.
114 115 116 |
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 114 def limit(value) merge(aulimit: value.to_s) end |
#prefix(value) ⇒ self
Search for all users that begin with this value.
41 42 43 |
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 41 def prefix(value) merge(auprefix: value.to_s) end |
#prop(*values) ⇒ self
Which pieces of information to include:
101 102 103 |
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 101 def prop(*values) values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" } end |
#rights(*values) ⇒ self
Only include users with the given rights. Does not include rights granted by implicit or auto-promoted groups like *, user, or autoconfirmed.
88 89 90 |
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 88 def rights(*values) values.inject(self) { |res, val| res._rights(val) or fail ArgumentError, "Unknown value for rights: #{val}" } end |
#to(value) ⇒ self
The user name to stop enumerating at.
33 34 35 |
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 33 def to(value) merge(auto: value.to_s) end |
#witheditsonly ⇒ self
Only list users who have made edits.
121 122 123 |
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 121 def witheditsonly() merge(auwitheditsonly: 'true') end |