Module: MediaWiktory::Wikipedia::Modules::Allmessages
- Defined in:
- lib/mediawiktory/wikipedia/modules/allmessages.rb
Overview
Return messages from this site.
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
-
#args(*values) ⇒ self
Arguments to be substituted into message.
-
#customised(value) ⇒ self
Return only messages in this customisation state.
-
#enableparser ⇒ self
Set to enable parser, will preprocess the wikitext of message (substitute magic words, handle templates, etc.).
-
#filter(value) ⇒ self
Return only messages with names that contain this string.
-
#from(value) ⇒ self
Return messages starting at this message.
-
#includelocal ⇒ self
Also include local messages, i.e.
-
#lang(value) ⇒ self
Return messages in this language.
-
#messages(*values) ⇒ self
Which messages to output.
-
#nocontent ⇒ self
If set, do not include the content of the messages in the output.
-
#prefix(value) ⇒ self
Return messages with this prefix.
-
#prop(*values) ⇒ self
Which properties to get.
-
#title(value) ⇒ self
Page name to use as context when parsing message (for amenableparser option).
-
#to(value) ⇒ self
Return messages ending at this message.
Instance Method Details
#args(*values) ⇒ self
Arguments to be substituted into message.
72 73 74 |
# File 'lib/mediawiktory/wikipedia/modules/allmessages.rb', line 72 def args(*values) values.inject(self) { |res, val| res._args(val) } end |
#customised(value) ⇒ self
Return only messages in this customisation state.
93 94 95 |
# File 'lib/mediawiktory/wikipedia/modules/allmessages.rb', line 93 def customised(value) _customised(value) or fail ArgumentError, "Unknown value for customised: #{value}" end |
#enableparser ⇒ self
Set to enable parser, will preprocess the wikitext of message (substitute magic words, handle templates, etc.).
50 51 52 |
# File 'lib/mediawiktory/wikipedia/modules/allmessages.rb', line 50 def enableparser() merge(amenableparser: 'true') end |
#filter(value) ⇒ self
Return only messages with names that contain this string.
85 86 87 |
# File 'lib/mediawiktory/wikipedia/modules/allmessages.rb', line 85 def filter(value) merge(amfilter: value.to_s) end |
#from(value) ⇒ self
Return messages starting at this message.
114 115 116 |
# File 'lib/mediawiktory/wikipedia/modules/allmessages.rb', line 114 def from(value) merge(amfrom: value.to_s) end |
#includelocal ⇒ self
Also include local messages, i.e. messages that don't exist in the software but do exist as in the MediaWiki namespace. This lists all MediaWiki-namespace pages, so it will also list those that aren't really messages such as Common.js.
64 65 66 |
# File 'lib/mediawiktory/wikipedia/modules/allmessages.rb', line 64 def includelocal() merge(amincludelocal: 'true') end |
#lang(value) ⇒ self
Return messages in this language.
106 107 108 |
# File 'lib/mediawiktory/wikipedia/modules/allmessages.rb', line 106 def lang(value) merge(amlang: value.to_s) end |
#messages(*values) ⇒ self
Which messages to output. * (default) means all messages.
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/allmessages.rb', line 25 def (*values) values.inject(self) { |res, val| res.(val) } end |
#nocontent ⇒ self
If set, do not include the content of the messages in the output.
57 58 59 |
# File 'lib/mediawiktory/wikipedia/modules/allmessages.rb', line 57 def nocontent() merge(amnocontent: 'true') end |
#prefix(value) ⇒ self
Return messages with this prefix.
138 139 140 |
# File 'lib/mediawiktory/wikipedia/modules/allmessages.rb', line 138 def prefix(value) merge(amprefix: value.to_s) end |
#prop(*values) ⇒ self
Which properties to get.
38 39 40 |
# File 'lib/mediawiktory/wikipedia/modules/allmessages.rb', line 38 def prop(*values) values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" } end |
#title(value) ⇒ self
Page name to use as context when parsing message (for amenableparser option).
130 131 132 |
# File 'lib/mediawiktory/wikipedia/modules/allmessages.rb', line 130 def title(value) merge(amtitle: value.to_s) end |
#to(value) ⇒ self
Return messages ending at this message.
122 123 124 |
# File 'lib/mediawiktory/wikipedia/modules/allmessages.rb', line 122 def to(value) merge(amto: value.to_s) end |