Class: MediaWiktory::Wikipedia::Actions::Jsonconfig
- Defined in:
- lib/mediawiktory/wikipedia/actions/jsonconfig.rb
Overview
Allows direct access to JsonConfig subsystem.
Usage:
api.jsonconfig.command(value).perform # returns string with raw output
# or
api.jsonconfig.command(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
-
#command(value) ⇒ self
Which sub-action to perform on JsonConfig:.
-
#content(value) ⇒ self
For command=reload, use this content instead.
-
#namespace(value) ⇒ self
Namespace number of the title to process.
-
#title(value) ⇒ self
Title to process without namespace prefix.
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
#command(value) ⇒ self
Which sub-action to perform on JsonConfig:
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/jsonconfig.rb', line 26 def command(value) _command(value) or fail ArgumentError, "Unknown value for command: #{value}" end |
#content(value) ⇒ self
For command=reload, use this content instead.
55 56 57 |
# File 'lib/mediawiktory/wikipedia/actions/jsonconfig.rb', line 55 def content(value) merge(content: value.to_s) end |
#namespace(value) ⇒ self
Namespace number of the title to process.
39 40 41 |
# File 'lib/mediawiktory/wikipedia/actions/jsonconfig.rb', line 39 def namespace(value) merge(namespace: value.to_s) end |
#title(value) ⇒ self
Title to process without namespace prefix.
47 48 49 |
# File 'lib/mediawiktory/wikipedia/actions/jsonconfig.rb', line 47 def title(value) merge(title: value.to_s) end |