Module: MediaWiktory::Wikipedia::Modules::Logevents
- Defined in:
- lib/mediawiktory/wikipedia/modules/logevents.rb
Overview
Get events from logs.
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
-
#action(value) ⇒ self
Filter log actions to only this action.
-
#continue(value) ⇒ self
When more results are available, use this to continue.
-
#dir(value) ⇒ self
In which direction to enumerate:.
-
#end(value) ⇒ self
The timestamp to end enumerating.
-
#limit(value) ⇒ self
How many total event entries to return.
-
#namespace(value) ⇒ self
Filter entries to those in the given namespace.
-
#prefix(value) ⇒ self
Disabled due to miser mode.
-
#prop(*values) ⇒ self
Which properties to get:.
-
#start(value) ⇒ self
The timestamp to start enumerating from.
-
#tag(value) ⇒ self
Only list event entries tagged with this tag.
-
#title(value) ⇒ self
Filter entries to those related to a page.
-
#type(value) ⇒ self
Filter log entries to only this type.
-
#user(value) ⇒ self
Filter entries to those made by the given user.
Instance Method Details
#action(value) ⇒ self
Filter log actions to only this action. Overrides letype. In the list of possible values, values with the asterisk wildcard such as action/* can have different strings after the slash (/).
51 52 53 |
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 51 def action(value) _action(value) or fail ArgumentError, "Unknown value for action: #{value}" end |
#continue(value) ⇒ self
When more results are available, use this to continue.
146 147 148 |
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 146 def continue(value) merge(lecontinue: value.to_s) end |
#dir(value) ⇒ self
In which direction to enumerate:
80 81 82 |
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 80 def dir(value) _dir(value) or fail ArgumentError, "Unknown value for dir: #{value}" end |
#end(value) ⇒ self
The timestamp to end enumerating.
72 73 74 |
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 72 def end(value) merge(leend: value.iso8601) end |
#limit(value) ⇒ self
How many total event entries to return.
138 139 140 |
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 138 def limit(value) merge(lelimit: value.to_s) end |
#namespace(value) ⇒ self
Filter entries to those in the given namespace.
109 110 111 |
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 109 def namespace(value) _namespace(value) or fail ArgumentError, "Unknown value for namespace: #{value}" end |
#prefix(value) ⇒ self
Disabled due to miser mode.
122 123 124 |
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 122 def prefix(value) merge(leprefix: value.to_s) end |
#prop(*values) ⇒ self
Which properties to get:
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 25 def prop(*values) values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" } end |
#start(value) ⇒ self
The timestamp to start enumerating from.
64 65 66 |
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 64 def start(value) merge(lestart: value.iso8601) end |
#tag(value) ⇒ self
Only list event entries tagged with this tag.
130 131 132 |
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 130 def tag(value) merge(letag: value.to_s) end |
#title(value) ⇒ self
Filter entries to those related to a page.
101 102 103 |
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 101 def title(value) merge(letitle: value.to_s) end |
#type(value) ⇒ self
Filter log entries to only this type.
38 39 40 |
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 38 def type(value) _type(value) or fail ArgumentError, "Unknown value for type: #{value}" end |
#user(value) ⇒ self
Filter entries to those made by the given user.
93 94 95 |
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 93 def user(value) merge(leuser: value.to_s) end |