class MediaWiktory::Wikipedia::Actions::Cxsuggestionlist

Manage the suggestion lists. Add suggestions to lists and remove them.

Usage:

“`ruby api.cxsuggestionlist.listname(value).perform # returns string with raw output # or api.cxsuggestionlist.listname(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

_listaction(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/cxsuggestionlist.rb, line 39
def _listaction(value)
  defined?(super) && super || ["add", "remove"].include?(value.to_s) && merge(listaction: value.to_s)
end
_titles(value) click to toggle source

@private

# File lib/mediawiktory/wikipedia/actions/cxsuggestionlist.rb, line 52
def _titles(value)
  merge(titles: value.to_s, replace: false)
end
from(value) click to toggle source

The source language code.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/cxsuggestionlist.rb, line 60
def from(value)
  merge(from: value.to_s)
end
listaction(value) click to toggle source

Action to be performed on the list.

@param value [String] One of “add”, “remove”. @return [self]

# File lib/mediawiktory/wikipedia/actions/cxsuggestionlist.rb, line 34
def listaction(value)
  _listaction(value) or fail ArgumentError, "Unknown value for listaction: #{value}"
end
listname(value) click to toggle source

Suggestion list name.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/cxsuggestionlist.rb, line 26
def listname(value)
  merge(listname: value.to_s)
end
titles(*values) click to toggle source

Page titles.

@param values [Array<String>] @return [self]

# File lib/mediawiktory/wikipedia/actions/cxsuggestionlist.rb, line 47
def titles(*values)
  values.inject(self) { |res, val| res._titles(val) }
end
to(value) click to toggle source

The target language code.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/cxsuggestionlist.rb, line 68
def to(value)
  merge(to: 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/cxsuggestionlist.rb, line 76
def token(value)
  merge(token: value.to_s)
end