Module: MediaWiktory::Wikipedia::Modules::Info
- Defined in:
- lib/mediawiktory/wikipedia/modules/info.rb
Overview
Get basic page information.
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
-
#continue(value) ⇒ self
When more results are available, use this to continue.
-
#prop(*values) ⇒ self
Which additional properties to get:.
-
#testactions(*values) ⇒ self
Test whether the current user can perform certain actions on the page.
-
#token(*values) ⇒ self
Use action=query&meta=tokens instead.
Instance Method Details
#continue(value) ⇒ self
When more results are available, use this to continue.
64 65 66 |
# File 'lib/mediawiktory/wikipedia/modules/info.rb', line 64 def continue(value) merge(incontinue: value.to_s) end |
#prop(*values) ⇒ self
Which additional properties to get:
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/info.rb', line 25 def prop(*values) values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" } end |
#testactions(*values) ⇒ self
Test whether the current user can perform certain actions on the page.
38 39 40 |
# File 'lib/mediawiktory/wikipedia/modules/info.rb', line 38 def testactions(*values) values.inject(self) { |res, val| res._testactions(val) } end |
#token(*values) ⇒ self
Use action=query&meta=tokens instead.
51 52 53 |
# File 'lib/mediawiktory/wikipedia/modules/info.rb', line 51 def token(*values) values.inject(self) { |res, val| res._token(val) or fail ArgumentError, "Unknown value for token: #{val}" } end |