class MediaWiktory::Wikipedia::Actions::Globalblock

Globally block or unblock a user.

Usage:

“`ruby api.globalblock.target(value).perform # returns string with raw output # or api.globalblock.target(value).response # returns output parsed and wrapped into Response object “`

See {Base} for generic explanation of working with MediaWiki actions and {MediaWiktory::Wikipedia::Response} for working with action responses.

All action's parameters are documented as its public methods, see below.

Public Instance Methods

anononly() click to toggle source

Specify this if the block should only affect logged-out users.

@return [self]

# File lib/mediawiktory/wikipedia/actions/globalblock.rb, line 56
def anononly()
  merge(anononly: 'true')
end
expiry(value) click to toggle source

If specified, will block or reblock the user. Determines how long the block will last for, e.g. “5 months” or “2 weeks”. If set to “infinite” or “indefinite” the block will never expire.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/globalblock.rb, line 34
def expiry(value)
  merge(expiry: value.to_s)
end
modify() click to toggle source

Specify this if the existing block on the target should be modified

@return [self]

# File lib/mediawiktory/wikipedia/actions/globalblock.rb, line 63
def modify()
  merge(modify: 'true')
end
reason(value) click to toggle source

The reason for blocking/unblocking.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/globalblock.rb, line 49
def reason(value)
  merge(reason: value.to_s)
end
target(value) click to toggle source

The target IP address.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/globalblock.rb, line 26
def target(value)
  merge(target: value.to_s)
end
token(value) click to toggle source

A “csrf” token retrieved from action=query&meta=tokens

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/globalblock.rb, line 71
def token(value)
  merge(token: value.to_s)
end
unblock() click to toggle source

If specified, will unblock the user.

@return [self]

# File lib/mediawiktory/wikipedia/actions/globalblock.rb, line 41
def unblock()
  merge(unblock: 'true')
end