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
@private
# 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
@private
# File lib/mediawiktory/wikipedia/actions/cxsuggestionlist.rb, line 52 def _titles(value) merge(titles: value.to_s, replace: false) end
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
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
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
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
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
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