Class: MediaWiktory::Wikipedia::Actions::Paraminfo

Inherits:
Get
  • Object
show all
Defined in:
lib/mediawiktory/wikipedia/actions/paraminfo.rb

Overview

Obtain information about API modules.

Usage:

api.paraminfo.modules(value).perform # returns string with raw output
# or
api.paraminfo.modules(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

Methods inherited from Get

#perform

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

#formatmodules(*values) ⇒ self

List of format module names (value of format parameter). Use modules instead.

Parameters:

  • values (Array<String>)

    Allowed values: "json", "jsonfm", "none", "php", "phpfm", "rawfm", "xml", "xmlfm".

Returns:

  • (self)


81
82
83
# File 'lib/mediawiktory/wikipedia/actions/paraminfo.rb', line 81

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

#helpformat(value) ⇒ self

Format of help strings.

Parameters:

  • value (String)

    One of "html", "wikitext", "raw", "none".

Returns:

  • (self)


39
40
41
# File 'lib/mediawiktory/wikipedia/actions/paraminfo.rb', line 39

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

#mainmodule(value) ⇒ self

Get information about the main (top-level) module as well. Use modules=main instead.

Parameters:

  • value (String)

Returns:

  • (self)


65
66
67
# File 'lib/mediawiktory/wikipedia/actions/paraminfo.rb', line 65

def mainmodule(value)
  merge(mainmodule: value.to_s)
end

#modules(*values) ⇒ self

List of module names (values of the action and format parameters, or main). Can specify submodules with a +, or all submodules with +, or all submodules recursively with +*.

Parameters:

  • values (Array<String>)

Returns:

  • (self)


26
27
28
# File 'lib/mediawiktory/wikipedia/actions/paraminfo.rb', line 26

def modules(*values)
  values.inject(self) { |res, val| res._modules(val) }
end

#pagesetmodule(value) ⇒ self

Get information about the pageset module (providing titles= and friends) as well.

Parameters:

  • value (String)

Returns:

  • (self)


73
74
75
# File 'lib/mediawiktory/wikipedia/actions/paraminfo.rb', line 73

def pagesetmodule(value)
  merge(pagesetmodule: value.to_s)
end

#querymodules(*values) ⇒ self

List of query module names (value of prop, meta or list parameter). Use modules=query+foo instead of querymodules=foo.

Parameters:

  • values (Array<String>)

    Allowed values: "abusefilters", "abuselog", "allcategories", "alldeletedrevisions", "allfileusages", "allimages", "alllinks", "allmessages", "allpages", "allredirects", "allrevisions", "alltransclusions", "allusers", "authmanagerinfo", "babel", "backlinks", "betafeatures", "blocks", "categories", "categoryinfo", "categorymembers", "centralnoticelogs", "checkuser", "checkuserlog", "contenttranslation", "contenttranslationcorpora", "contenttranslationlangtrend", "contenttranslationstats", "contenttranslationsuggestions", "contributors", "coordinates", "cxpublishedtranslations", "cxtranslatorstats", "deletedrevisions", "deletedrevs", "duplicatefiles", "embeddedin", "extlinks", "extracts", "exturlusage", "featureusage", "filearchive", "filerepoinfo", "fileusage", "flagged", "gadgetcategories", "gadgets", "geosearch", "gettingstartedgetpages", "globalallusers", "globalblocks", "globalgroups", "globalusage", "globaluserinfo", "imageinfo", "images", "imageusage", "info", "iwbacklinks", "iwlinks", "langbacklinks", "langlinks", "links", "linkshere", "logevents", "mapdata", "mmsites", "mostviewed", "mystashedfiles", "notifications", "oath", "oldreviewedpages", "ores", "pageassessments", "pageimages", "pagepropnames", "pageprops", "pageswithprop", "pageterms", "pageviews", "prefixsearch", "projectpages", "projects", "protectedtitles", "querypage", "random", "recentchanges", "redirects", "references", "revisions", "search", "siteinfo", "siteviews", "stashimageinfo", "tags", "templates", "tokens", "transcludedin", "transcodestatus", "unreadnotificationpages", "usercontribs", "userinfo", "users", "videoinfo", "watchlist", "watchlistraw", "wbentityusage", "wblistentityusage", "wikibase", "wikisets".

Returns:

  • (self)


52
53
54
# File 'lib/mediawiktory/wikipedia/actions/paraminfo.rb', line 52

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