class MediaWiktory::Wikipedia::Actions::Sitematrix
Get
Wikimedia sites list.
Usage:
“`ruby api.sitematrix.type(value).perform # returns string with raw output # or api.sitematrix.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/sitematrix.rb, line 57 def _langprop(value) defined?(super) && super || ["code", "name", "site", "localname"].include?(value.to_s) && merge(smlangprop: value.to_s, replace: false) end
@private
# File lib/mediawiktory/wikipedia/actions/sitematrix.rb, line 70 def _siteprop(value) defined?(super) && super || ["url", "dbname", "code", "sitename"].include?(value.to_s) && merge(smsiteprop: value.to_s, replace: false) end
@private
# File lib/mediawiktory/wikipedia/actions/sitematrix.rb, line 44 def _state(value) defined?(super) && super || ["all", "closed", "private", "fishbowl", "nonglobal"].include?(value.to_s) && merge(smstate: value.to_s, replace: false) end
@private
# File lib/mediawiktory/wikipedia/actions/sitematrix.rb, line 31 def _type(value) defined?(super) && super || ["special", "language"].include?(value.to_s) && merge(smtype: value.to_s, replace: false) end
When more results are available, use this to continue.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/sitematrix.rb, line 86 def continue(value) merge(smcontinue: value.to_s) end
Which information about a language to return.
@param values [Array<String>] Allowed values: “code”, “name”, “site”, “localname”. @return [self]
# File lib/mediawiktory/wikipedia/actions/sitematrix.rb, line 52 def langprop(*values) values.inject(self) { |res, val| res._langprop(val) or fail ArgumentError, "Unknown value for langprop: #{val}" } end
Maximum number of results.
@param value [Integer, “max”] @return [self]
# File lib/mediawiktory/wikipedia/actions/sitematrix.rb, line 78 def limit(value) merge(smlimit: value.to_s) end
Which information about a site to return.
@param values [Array<String>] Allowed values: “url”, “dbname”, “code”, “sitename”. @return [self]
# File lib/mediawiktory/wikipedia/actions/sitematrix.rb, line 65 def siteprop(*values) values.inject(self) { |res, val| res._siteprop(val) or fail ArgumentError, "Unknown value for siteprop: #{val}" } end
Filter the Site Matrix by wiki state:
@param values [Array<String>] Allowed values: “all”, “closed”, “private”, “fishbowl”, “nonglobal”. @return [self]
# File lib/mediawiktory/wikipedia/actions/sitematrix.rb, line 39 def state(*values) values.inject(self) { |res, val| res._state(val) or fail ArgumentError, "Unknown value for state: #{val}" } end
Filter the Site Matrix by type:
@param values [Array<String>] Allowed values: “special” (One off and multilingual Wikimedia projects), “language” (Wikimedia projects under this language code). @return [self]
# File lib/mediawiktory/wikipedia/actions/sitematrix.rb, line 26 def type(*values) values.inject(self) { |res, val| res._type(val) or fail ArgumentError, "Unknown value for type: #{val}" } end