Module: MediaWiktory::Wikipedia::Modules::Globaluserinfo

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

Overview

Show information about a global user.

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

#prop(*values) ⇒ self

Which properties to get:

Parameters:

  • values (Array<String>)

    Allowed values: "groups" (Get a list of global groups this user belongs to), "rights" (Get a list of global rights this user has), "merged" (Get a list of merged accounts), "unattached" (Get a list of unattached accounts), "editcount" (Get the user's global edit count).

Returns:

  • (self)


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

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

#user(value) ⇒ self

User to get information about. Defaults to the current user.

Parameters:

  • value (String)

Returns:

  • (self)


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

def user(value)
  merge(guiuser: value.to_s)
end