class MediaWiktory::Wikipedia::Actions::Checktoken
Check the validity of a token from action=query&meta=tokens.
Usage:
“`ruby api.checktoken.type(value).perform # returns string with raw output # or api.checktoken.type(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
@private
# File lib/mediawiktory/wikipedia/actions/checktoken.rb, line 31 def _type(value) defined?(super) && super || ["createaccount", "csrf", "deleteglobalaccount", "login", "patrol", "rollback", "setglobalaccountstatus", "userrights", "watch"].include?(value.to_s) && merge(type: value.to_s) end
Maximum allowed age of the token, in seconds.
@param value [Integer] @return [self]
# File lib/mediawiktory/wikipedia/actions/checktoken.rb, line 47 def maxtokenage(value) merge(maxtokenage: value.to_s) end
Token to test.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/checktoken.rb, line 39 def token(value) merge(token: value.to_s) end
Type of token being tested.
@param value [String] One of “createaccount”, “csrf”, “deleteglobalaccount”, “login”, “patrol”, “rollback”, “setglobalaccountstatus”, “userrights”, “watch”. @return [self]
# File lib/mediawiktory/wikipedia/actions/checktoken.rb, line 26 def type(value) _type(value) or fail ArgumentError, "Unknown value for type: #{value}" end