class MediaWiktory::Wikipedia::Actions::Block
Block
a user.
Usage:
“`ruby api.block.user(value).perform # returns string with raw output # or api.block.user(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
Allow the user to edit their own talk page (depends on $wgBlockAllowsUTEdit).
@return [self]
# File lib/mediawiktory/wikipedia/actions/block.rb, line 92 def allowusertalk() merge(allowusertalk: 'true') end
Block
anonymous users only (i.e. disable anonymous edits for this IP address).
@return [self]
# File lib/mediawiktory/wikipedia/actions/block.rb, line 57 def anononly() merge(anononly: 'true') end
Automatically block the last used IP address, and any subsequent IP addresses they try to login from.
@return [self]
# File lib/mediawiktory/wikipedia/actions/block.rb, line 71 def autoblock() merge(autoblock: 'true') end
Expiry time. May be relative (e.g. 5 months or 2 weeks) or absolute (e.g. 2014-09-18T12:34:56Z). If set to infinite, indefinite, or never, the block will never expire.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/block.rb, line 42 def expiry(value) merge(expiry: value.to_s) end
Hide the username from the block log. (Requires the hideuser right).
@return [self]
# File lib/mediawiktory/wikipedia/actions/block.rb, line 85 def hidename() merge(hidename: 'true') end
Prevent account creation.
@return [self]
# File lib/mediawiktory/wikipedia/actions/block.rb, line 64 def nocreate() merge(nocreate: 'true') end
Prevent user from sending email through the wiki. (Requires the blockemail right).
@return [self]
# File lib/mediawiktory/wikipedia/actions/block.rb, line 78 def noemail() merge(noemail: 'true') end
Reason for block.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/block.rb, line 50 def reason(value) merge(reason: value.to_s) end
If the user is already blocked, overwrite the existing block.
@return [self]
# File lib/mediawiktory/wikipedia/actions/block.rb, line 99 def reblock() merge(reblock: 'true') end
A “csrf” token retrieved from action=query&meta=tokens
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/block.rb, line 127 def token(value) merge(token: value.to_s) end
Username, IP address, or IP address range to block. Cannot be used together with userid
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/block.rb, line 26 def user(value) merge(user: value.to_s) end
User ID to block. Cannot be used together with user.
@param value [Integer] @return [self]
# File lib/mediawiktory/wikipedia/actions/block.rb, line 34 def userid(value) merge(userid: value.to_s) end
Watch
the user's or IP address's user and talk pages.
@return [self]
# File lib/mediawiktory/wikipedia/actions/block.rb, line 106 def watchuser() merge(watchuser: 'true') end