module MediaWiktory::Wikipedia::Modules::Globalblocks

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 {MediaWiktory::Wikipedia::Actions::Query} and its submodules):

“`ruby 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.

Public Instance Methods

_addresses(value) click to toggle source

@private

# File lib/mediawiktory/wikipedia/modules/globalblocks.rb, line 72
def _addresses(value)
  merge(bgaddresses: value.to_s, replace: false)
end
_dir(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/globalblocks.rb, line 46
def _dir(value)
  defined?(super) && super || ["newer", "older"].include?(value.to_s) && merge(bgdir: value.to_s)
end
_ids(value) click to toggle source

@private

# File lib/mediawiktory/wikipedia/modules/globalblocks.rb, line 59
def _ids(value)
  merge(bgids: value.to_s, replace: false)
end
_prop(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/globalblocks.rb, line 101
def _prop(value)
  defined?(super) && super || ["id", "address", "by", "timestamp", "expiry", "reason", "range"].include?(value.to_s) && merge(bgprop: value.to_s, replace: false)
end
addresses(*values) click to toggle source

Pipe-separated list of IP addresses to search for.

@param values [Array<String>] @return [self]

# File lib/mediawiktory/wikipedia/modules/globalblocks.rb, line 67
def addresses(*values)
  values.inject(self) { |res, val| res._addresses(val) }
end
dir(value) click to toggle source

In which direction to enumerate:

@param value [String] One of “newer” (List oldest first. Note: bgstart has to be before bgend), “older” (List newest first (default). Note: bgstart has to be later than bgend). @return [self]

# 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) click to toggle source

The timestamp to stop enumerating at.

@param value [Time] @return [self]

# File lib/mediawiktory/wikipedia/modules/globalblocks.rb, line 33
def end(value)
  merge(bgend: value.iso8601)
end
ids(*values) click to toggle source

Pipe-separated list of block IDs to list.

@param values [Array<Integer>] @return [self]

# File lib/mediawiktory/wikipedia/modules/globalblocks.rb, line 54
def ids(*values)
  values.inject(self) { |res, val| res._ids(val) }
end
ip(value) click to toggle source

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.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/globalblocks.rb, line 80
def ip(value)
  merge(bgip: value.to_s)
end
limit(value) click to toggle source

The maximum amount of blocks to list.

@param value [Integer, “max”] @return [self]

# File lib/mediawiktory/wikipedia/modules/globalblocks.rb, line 88
def limit(value)
  merge(bglimit: value.to_s)
end
prop(*values) click to toggle source

Which properties to get.

@param values [Array<String>] Allowed values: “id”, “address”, “by”, “timestamp”, “expiry”, “reason”, “range”. @return [self]

# 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) click to toggle source

The timestamp to start enumerating from.

@param value [Time] @return [self]

# File lib/mediawiktory/wikipedia/modules/globalblocks.rb, line 25
def start(value)
  merge(bgstart: value.iso8601)
end