Module: MediaWiktory::Wikipedia::Modules::Abusefilters

Defined in:
lib/mediawiktory/wikipedia/modules/abusefilters.rb

Overview

Show details of the abuse filters.

The "submodule" (MediaWiki API term) is included in action after setting some param, providing additional tweaking for this param. Example (for Actions::Query and its submodules):

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.

Instance Method Summary collapse

Instance Method Details

#dir(value) ⇒ self

In which direction to enumerate:

Parameters:

  • value (String)

    One of "newer" (List oldest first. Note: abfstart has to be before abfend), "older" (List newest first (default). Note: abfstart has to be later than abfend).

Returns:

  • (self)


41
42
43
# File 'lib/mediawiktory/wikipedia/modules/abusefilters.rb', line 41

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

#endid(value) ⇒ self

The filter ID to stop enumerating at.

Parameters:

  • value (Integer)

Returns:

  • (self)


33
34
35
# File 'lib/mediawiktory/wikipedia/modules/abusefilters.rb', line 33

def endid(value)
  merge(abfendid: value.to_s)
end

#limit(value) ⇒ self

The maximum number of filters to list.

Parameters:

  • value (Integer, "max")

Returns:

  • (self)


67
68
69
# File 'lib/mediawiktory/wikipedia/modules/abusefilters.rb', line 67

def limit(value)
  merge(abflimit: value.to_s)
end

#prop(*values) ⇒ self

Which properties to get.

Parameters:

  • values (Array<String>)

    Allowed values: "id", "description", "pattern", "actions", "hits", "comments", "lasteditor", "lastedittime", "status", "private".

Returns:

  • (self)


75
76
77
# File 'lib/mediawiktory/wikipedia/modules/abusefilters.rb', line 75

def prop(*values)
  values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" }
end

#show(*values) ⇒ self

Show only filters which meet these criteria.

Parameters:

  • values (Array<String>)

    Allowed values: "enabled", "!enabled", "deleted", "!deleted", "private", "!private".

Returns:

  • (self)


54
55
56
# File 'lib/mediawiktory/wikipedia/modules/abusefilters.rb', line 54

def show(*values)
  values.inject(self) { |res, val| res._show(val) or fail ArgumentError, "Unknown value for show: #{val}" }
end

#startid(value) ⇒ self

The filter ID to start enumerating from.

Parameters:

  • value (Integer)

Returns:

  • (self)


25
26
27
# File 'lib/mediawiktory/wikipedia/modules/abusefilters.rb', line 25

def startid(value)
  merge(abfstartid: value.to_s)
end