Module: MediaWiktory::Wikipedia::Modules::Allpages
- Defined in:
- lib/mediawiktory/wikipedia/modules/allpages.rb
Overview
Enumerate all pages sequentially in a given namespace.
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.
-
#dir(value) ⇒ self
The direction in which to list.
-
#filterlanglinks(value) ⇒ self
Filter based on whether a page has langlinks.
-
#filterredir(value) ⇒ self
Which pages to list.
-
#from(value) ⇒ self
The page title to start enumerating from.
-
#limit(value) ⇒ self
How many total pages to return.
-
#maxsize(value) ⇒ self
Limit to pages with at most this many bytes.
-
#minsize(value) ⇒ self
Limit to pages with at least this many bytes.
-
#namespace(value) ⇒ self
The namespace to enumerate.
-
#prefix(value) ⇒ self
Search for all page titles that begin with this value.
-
#prexpiry(value) ⇒ self
Which protection expiry to filter the page on:.
-
#prfiltercascade(value) ⇒ self
Filter protections based on cascadingness (ignored when apprtype isn't set).
-
#prlevel(*values) ⇒ self
Filter protections based on protection level (must be used with apprtype= parameter).
-
#prtype(*values) ⇒ self
Limit to protected pages only.
-
#to(value) ⇒ self
The page title to stop enumerating at.
Instance Method Details
#continue(value) ⇒ self
When more results are available, use this to continue.
33 34 35 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 33 def continue(value) merge(apcontinue: value.to_s) end |
#dir(value) ⇒ self
The direction in which to list.
146 147 148 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 146 def dir(value) _dir(value) or fail ArgumentError, "Unknown value for dir: #{value}" end |
#filterlanglinks(value) ⇒ self
Filter based on whether a page has langlinks. Note that this may not consider langlinks added by extensions.
159 160 161 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 159 def filterlanglinks(value) _filterlanglinks(value) or fail ArgumentError, "Unknown value for filterlanglinks: #{value}" end |
#filterredir(value) ⇒ self
Which pages to list.
70 71 72 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 70 def filterredir(value) _filterredir(value) or fail ArgumentError, "Unknown value for filterredir: #{value}" end |
#from(value) ⇒ self
The page title to start enumerating from.
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 25 def from(value) merge(apfrom: value.to_s) end |
#limit(value) ⇒ self
How many total pages to return.
138 139 140 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 138 def limit(value) merge(aplimit: value.to_s) end |
#maxsize(value) ⇒ self
Limit to pages with at most this many bytes.
91 92 93 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 91 def maxsize(value) merge(apmaxsize: value.to_s) end |
#minsize(value) ⇒ self
Limit to pages with at least this many bytes.
83 84 85 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 83 def minsize(value) merge(apminsize: value.to_s) end |
#namespace(value) ⇒ self
The namespace to enumerate.
57 58 59 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 57 def namespace(value) _namespace(value) or fail ArgumentError, "Unknown value for namespace: #{value}" end |
#prefix(value) ⇒ self
Search for all page titles that begin with this value.
49 50 51 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 49 def prefix(value) merge(apprefix: value.to_s) end |
#prexpiry(value) ⇒ self
Which protection expiry to filter the page on:
172 173 174 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 172 def prexpiry(value) _prexpiry(value) or fail ArgumentError, "Unknown value for prexpiry: #{value}" end |
#prfiltercascade(value) ⇒ self
Filter protections based on cascadingness (ignored when apprtype isn't set).
125 126 127 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 125 def prfiltercascade(value) _prfiltercascade(value) or fail ArgumentError, "Unknown value for prfiltercascade: #{value}" end |
#prlevel(*values) ⇒ self
Filter protections based on protection level (must be used with apprtype= parameter).
112 113 114 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 112 def prlevel(*values) values.inject(self) { |res, val| res._prlevel(val) or fail ArgumentError, "Unknown value for prlevel: #{val}" } end |
#prtype(*values) ⇒ self
Limit to protected pages only.
99 100 101 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 99 def prtype(*values) values.inject(self) { |res, val| res._prtype(val) or fail ArgumentError, "Unknown value for prtype: #{val}" } end |
#to(value) ⇒ self
The page title to stop enumerating at.
41 42 43 |
# File 'lib/mediawiktory/wikipedia/modules/allpages.rb', line 41 def to(value) merge(apto: value.to_s) end |