Module: MediaWiktory::Wikipedia::Modules::Gadgets
- Defined in:
- lib/mediawiktory/wikipedia/modules/gadgets.rb
Overview
Returns a list of gadgets used on this wiki.
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
-
#allowedonly ⇒ self
List only gadgets allowed to current user.
-
#categories(*values) ⇒ self
Gadgets from what categories to retrieve.
-
#enabledonly ⇒ self
List only gadgets enabled by current user.
-
#ids(*values) ⇒ self
IDs of gadgets to retrieve.
-
#prop(*values) ⇒ self
What gadget information to get:.
Instance Method Details
#allowedonly ⇒ self
List only gadgets allowed to current user.
63 64 65 |
# File 'lib/mediawiktory/wikipedia/modules/gadgets.rb', line 63 def allowedonly() merge(gaallowedonly: 'true') end |
#categories(*values) ⇒ self
Gadgets from what categories to retrieve.
38 39 40 |
# File 'lib/mediawiktory/wikipedia/modules/gadgets.rb', line 38 def categories(*values) values.inject(self) { |res, val| res._categories(val) } end |
#enabledonly ⇒ self
List only gadgets enabled by current user.
70 71 72 |
# File 'lib/mediawiktory/wikipedia/modules/gadgets.rb', line 70 def enabledonly() merge(gaenabledonly: 'true') end |
#ids(*values) ⇒ self
IDs of gadgets to retrieve.
51 52 53 |
# File 'lib/mediawiktory/wikipedia/modules/gadgets.rb', line 51 def ids(*values) values.inject(self) { |res, val| res._ids(val) } end |
#prop(*values) ⇒ self
What gadget information to get:
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/gadgets.rb', line 25 def prop(*values) values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" } end |