Module: MediaWiktory::Wikipedia::Modules::Globalblocks
- Defined in:
- lib/mediawiktory/wikipedia/modules/globalblocks.rb
Overview
List all globally blocked IP addresses.
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
-
#addresses(*values) ⇒ self
Pipe-separated list of IP addresses to search for.
-
#dir(value) ⇒ self
In which direction to enumerate:.
-
#end(value) ⇒ self
The timestamp to stop enumerating at.
-
#ids(*values) ⇒ self
Pipe-separated list of block IDs to list.
-
#ip(value) ⇒ self
Get all blocks applying to this IP address or CIDR range, including range blocks.
-
#limit(value) ⇒ self
The maximum amount of blocks to list.
-
#prop(*values) ⇒ self
Which properties to get.
-
#start(value) ⇒ self
The timestamp to start enumerating from.
Instance Method Details
#addresses(*values) ⇒ self
Pipe-separated list of IP addresses to search for.
67 68 69 |
# File 'lib/mediawiktory/wikipedia/modules/globalblocks.rb', line 67 def addresses(*values) values.inject(self) { |res, val| res._addresses(val) } end |
#dir(value) ⇒ self
In which direction to enumerate:
41 42 43 |
# File 'lib/mediawiktory/wikipedia/modules/globalblocks.rb', line 41 def dir(value) _dir(value) or fail ArgumentError, "Unknown value for dir: #{value}" end |
#end(value) ⇒ self
The timestamp to stop enumerating at.
33 34 35 |
# File 'lib/mediawiktory/wikipedia/modules/globalblocks.rb', line 33 def end(value) merge(bgend: value.iso8601) end |
#ids(*values) ⇒ self
Pipe-separated list of block IDs to list.
54 55 56 |
# File 'lib/mediawiktory/wikipedia/modules/globalblocks.rb', line 54 def ids(*values) values.inject(self) { |res, val| res._ids(val) } end |
#ip(value) ⇒ self
Get all blocks applying to this IP address or CIDR range, including range blocks. Cannot be used together with bgaddresses. CIDR ranges broader than /16 are not accepted.
80 81 82 |
# File 'lib/mediawiktory/wikipedia/modules/globalblocks.rb', line 80 def ip(value) merge(bgip: value.to_s) end |
#limit(value) ⇒ self
The maximum amount of blocks to list.
88 89 90 |
# File 'lib/mediawiktory/wikipedia/modules/globalblocks.rb', line 88 def limit(value) merge(bglimit: value.to_s) end |
#prop(*values) ⇒ self
Which properties to get.
96 97 98 |
# File 'lib/mediawiktory/wikipedia/modules/globalblocks.rb', line 96 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.
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/globalblocks.rb', line 25 def start(value) merge(bgstart: value.iso8601) end |