Module: MediaWiktory::Wikipedia::Modules::Wblistentityusage
- Defined in:
- lib/mediawiktory/wikipedia/modules/wblistentityusage.rb
Overview
Returns all pages that use the given entity IDs.
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
-
#aspect(*values) ⇒ self
Only return entity IDs that used this aspect.
-
#continue(value) ⇒ self
When more results are available, use this to continue.
-
#entities(*values) ⇒ self
Entities that have been used.
-
#limit(value) ⇒ self
How many entity usages to return.
-
#prop(*values) ⇒ self
Properties to add to the result.
Instance Method Details
#aspect(*values) ⇒ self
Only return entity IDs that used this aspect.
38 39 40 |
# File 'lib/mediawiktory/wikipedia/modules/wblistentityusage.rb', line 38 def aspect(*values) values.inject(self) { |res, val| res._aspect(val) or fail ArgumentError, "Unknown value for aspect: #{val}" } end |
#continue(value) ⇒ self
When more results are available, use this to continue.
72 73 74 |
# File 'lib/mediawiktory/wikipedia/modules/wblistentityusage.rb', line 72 def continue(value) merge(wbeucontinue: value.to_s) end |
#entities(*values) ⇒ self
Entities that have been used.
51 52 53 |
# File 'lib/mediawiktory/wikipedia/modules/wblistentityusage.rb', line 51 def entities(*values) values.inject(self) { |res, val| res._entities(val) } end |
#limit(value) ⇒ self
How many entity usages to return.
64 65 66 |
# File 'lib/mediawiktory/wikipedia/modules/wblistentityusage.rb', line 64 def limit(value) merge(wbeulimit: value.to_s) end |
#prop(*values) ⇒ self
Properties to add to the result.
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/wblistentityusage.rb', line 25 def prop(*values) values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" } end |