Class: MediaWiktory::Wikipedia::Actions::Help

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

Overview

Display help for the specified modules.

Usage:

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

#modules(*values) ⇒ self

Modules to display help for (values of the action and format parameters, or main). Can specify submodules with a +.

Parameters:

  • values (Array<String>)

Returns:

  • (self)


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

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

#recursivesubmodulesself

Include help for submodules recursively.

Returns:

  • (self)


45
46
47
# File 'lib/mediawiktory/wikipedia/actions/help.rb', line 45

def recursivesubmodules()
  merge(recursivesubmodules: 'true')
end

#submodulesself

Include help for submodules of the named module.

Returns:

  • (self)


38
39
40
# File 'lib/mediawiktory/wikipedia/actions/help.rb', line 38

def submodules()
  merge(submodules: 'true')
end

#tocself

Include a table of contents in the HTML output.

Returns:

  • (self)


59
60
61
# File 'lib/mediawiktory/wikipedia/actions/help.rb', line 59

def toc()
  merge(toc: 'true')
end

#wrapself

Wrap the output in a standard API response structure.

Returns:

  • (self)


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

def wrap()
  merge(wrap: 'true')
end