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

Instance Method Details

#agent(value) ⇒ self

User agent to query. If not specified, the agent in the request will be queried.

Parameters:

  • value (String)

Returns:

  • (self)


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.

Parameters:

  • value (Time)

Returns:

  • (self)


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.

Parameters:

  • values (Array<String>)

Returns:

  • (self)


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.

Parameters:

  • value (Time)

Returns:

  • (self)


25
26
27
# File 'lib/mediawiktory/wikipedia/modules/featureusage.rb', line 25

def start(value)
  merge(afustart: value.iso8601)
end