Class: MediaWiktory::Wikipedia::Actions::Paraminfo
- 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
-
#formatmodules(*values) ⇒ self
List of format module names (value of format parameter).
-
#helpformat(value) ⇒ self
Format of help strings.
-
#mainmodule(value) ⇒ self
Get information about the main (top-level) module as well.
-
#modules(*values) ⇒ self
List of module names (values of the action and format parameters, or main).
-
#pagesetmodule(value) ⇒ self
Get information about the pageset module (providing titles= and friends) as well.
-
#querymodules(*values) ⇒ self
List of query module names (value of prop, meta or list parameter).
Methods inherited from Get
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.
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.
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.
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 +*.
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.
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.
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 |