Class: MediaWiktory::Wikipedia::Actions::Titleblacklist

Inherits:
Get
  • Object
show all
Defined in:
lib/mediawiktory/wikipedia/actions/titleblacklist.rb

Overview

Validate an article title, filename, or username against the TitleBlacklist.

Usage:

api.titleblacklist.title(value).perform # returns string with raw output
# or
api.titleblacklist.title(value).response # returns output parsed and wrapped into Response object

See Base for generic explanation of working with MediaWiki actions and Response for working with action responses.

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

Instance Method Summary collapse

Methods inherited from Get

#perform

Methods inherited from Base

#inspect, #merge, #name, #perform, #response, #to_h, #to_param, #to_url

Methods included from GlobalParams

#assert, #assertuser, #centralauthtoken, #curtimestamp, #errorformat, #errorlang, #errorsuselocal, #format, #maxage, #maxlag, #origin, #requestid, #responselanginfo, #servedby, #smaxage, #uselang

Instance Method Details

#action(value) ⇒ self

The action to be checked.

Parameters:

  • value (String)

    One of "create", "edit", "upload", "createtalk", "createpage", "move", "new-account".

Returns:

  • (self)


34
35
36
# File 'lib/mediawiktory/wikipedia/actions/titleblacklist.rb', line 34

def action(value)
  _action(value) or fail ArgumentError, "Unknown value for action: #{value}"
end

#nooverrideself

Don't try to override the titleblacklist.

Returns:

  • (self)


46
47
48
# File 'lib/mediawiktory/wikipedia/actions/titleblacklist.rb', line 46

def nooverride()
  merge(tbnooverride: 'true')
end

#title(value) ⇒ self

The string to validate against the blacklist.

Parameters:

  • value (String)

Returns:

  • (self)


26
27
28
# File 'lib/mediawiktory/wikipedia/actions/titleblacklist.rb', line 26

def title(value)
  merge(tbtitle: value.to_s)
end