Module: MediaWiktory::Wikipedia::Modules::Globalallusers

Defined in:
lib/mediawiktory/wikipedia/modules/globalallusers.rb

Overview

Enumerate all global 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

Instance Method Details

#dir(value) ⇒ self

Direction to sort in.

Parameters:

  • value (String)

    One of "ascending", "descending".

Returns:

  • (self)


49
50
51
# File 'lib/mediawiktory/wikipedia/modules/globalallusers.rb', line 49

def dir(value)
  _dir(value) or fail ArgumentError, "Unknown value for dir: #{value}"
end

#excludegroup(*values) ⇒ self

Exclude users in given global groups.

Parameters:

  • values (Array<String>)

    Allowed values: "OTRS-member", "abusefilter-helper", "apihighlimits-requestor", "captcha-exempt", "delete-global", "founder", "global-bot", "global-flow-create", "global-interface-editor", "global-ipblock-exempt", "global-rollbacker", "global-sysop", "new-wikis-importer", "oathauth-tester", "ombudsman", "recursive-export", "staff", "steward", "sysadmin", "wmf-ops-monitoring", "wmf-researcher".

Returns:

  • (self)


75
76
77
# File 'lib/mediawiktory/wikipedia/modules/globalallusers.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.

Parameters:

  • value (String)

Returns:

  • (self)


25
26
27
# File 'lib/mediawiktory/wikipedia/modules/globalallusers.rb', line 25

def from(value)
  merge(agufrom: value.to_s)
end

#group(*values) ⇒ self

Limit users to given global groups.

Parameters:

  • values (Array<String>)

    Allowed values: "OTRS-member", "abusefilter-helper", "apihighlimits-requestor", "captcha-exempt", "delete-global", "founder", "global-bot", "global-flow-create", "global-interface-editor", "global-ipblock-exempt", "global-rollbacker", "global-sysop", "new-wikis-importer", "oathauth-tester", "ombudsman", "recursive-export", "staff", "steward", "sysadmin", "wmf-ops-monitoring", "wmf-researcher".

Returns:

  • (self)


62
63
64
# File 'lib/mediawiktory/wikipedia/modules/globalallusers.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.

Parameters:

  • value (Integer, "max")

Returns:

  • (self)


101
102
103
# File 'lib/mediawiktory/wikipedia/modules/globalallusers.rb', line 101

def limit(value)
  merge(agulimit: value.to_s)
end

#prefix(value) ⇒ self

Search for all users that begin with this value.

Parameters:

  • value (String)

Returns:

  • (self)


41
42
43
# File 'lib/mediawiktory/wikipedia/modules/globalallusers.rb', line 41

def prefix(value)
  merge(aguprefix: value.to_s)
end

#prop(*values) ⇒ self

What pieces of information to include:

Parameters:

  • values (Array<String>)

    Allowed values: "lockinfo" (Whether the user account is locked), "groups" (Lists global groups that the user is in. This uses more server resources and may return fewer results than the limit), "existslocally" (Adds the information if the user exists locally).

Returns:

  • (self)


88
89
90
# File 'lib/mediawiktory/wikipedia/modules/globalallusers.rb', line 88

def prop(*values)
  values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" }
end

#to(value) ⇒ self

The user name to stop enumerating at.

Parameters:

  • value (String)

Returns:

  • (self)


33
34
35
# File 'lib/mediawiktory/wikipedia/modules/globalallusers.rb', line 33

def to(value)
  merge(aguto: value.to_s)
end