Module: MediaWiktory::Wikipedia::Modules::Wikisets
- Defined in:
- lib/mediawiktory/wikipedia/modules/wikisets.rb
Overview
Enumerate all wiki sets.
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
-
#from(value) ⇒ self
The name of the wiki set to start from.
-
#limit(value) ⇒ self
How many wiki sets to return.
-
#orderbyname ⇒ self
Order results by name.
-
#prop(*values) ⇒ self
What pieces of information to include.
Instance Method Details
#from(value) ⇒ self
The name of the wiki set to start from.
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/wikisets.rb', line 25 def from(value) merge(wsfrom: value.to_s) end |
#limit(value) ⇒ self
How many wiki sets to return.
46 47 48 |
# File 'lib/mediawiktory/wikipedia/modules/wikisets.rb', line 46 def limit(value) merge(wslimit: value.to_s) end |
#orderbyname ⇒ self
Order results by name.
53 54 55 |
# File 'lib/mediawiktory/wikipedia/modules/wikisets.rb', line 53 def orderbyname() merge(wsorderbyname: 'true') end |
#prop(*values) ⇒ self
What pieces of information to include.
33 34 35 |
# File 'lib/mediawiktory/wikipedia/modules/wikisets.rb', line 33 def prop(*values) values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" } end |