Module: MediaWiktory::Wikipedia::Modules::Featureusage
- Defined in:
- lib/mediawiktory/wikipedia/modules/featureusage.rb
Overview
Get a summary of logged API feature usages for a user agent.
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
-
#agent(value) ⇒ self
User agent to query.
-
#end(value) ⇒ self
End of date range to query.
-
#features(*values) ⇒ self
If specified, return details on only these features.
-
#start(value) ⇒ self
Start of date range to query.
Instance Method Details
#agent(value) ⇒ self
User agent to query. If not specified, the agent in the request will be queried.
41 42 43 |
# File 'lib/mediawiktory/wikipedia/modules/featureusage.rb', line 41 def agent(value) merge(afuagent: value.to_s) end |
#end(value) ⇒ self
End of date range to query.
33 34 35 |
# File 'lib/mediawiktory/wikipedia/modules/featureusage.rb', line 33 def end(value) merge(afuend: value.iso8601) end |
#features(*values) ⇒ self
If specified, return details on only these features.
49 50 51 |
# File 'lib/mediawiktory/wikipedia/modules/featureusage.rb', line 49 def features(*values) values.inject(self) { |res, val| res._features(val) } end |
#start(value) ⇒ self
Start of date range to query.
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/featureusage.rb', line 25 def start(value) merge(afustart: value.iso8601) end |