Class: MediaWiktory::Wikipedia::Actions::Sitematrix
- Defined in:
- lib/mediawiktory/wikipedia/actions/sitematrix.rb
Overview
Get Wikimedia sites list.
Usage:
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 Response for working with action responses.
All action's parameters are documented as its public methods, see below.
Instance Method Summary collapse
-
#continue(value) ⇒ self
When more results are available, use this to continue.
-
#langprop(*values) ⇒ self
Which information about a language to return.
-
#limit(value) ⇒ self
Maximum number of results.
-
#siteprop(*values) ⇒ self
Which information about a site to return.
-
#state(*values) ⇒ self
Filter the Site Matrix by wiki state:.
-
#type(*values) ⇒ self
Filter the Site Matrix by type:.
Methods inherited from Get
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
#continue(value) ⇒ self
When more results are available, use this to continue.
86 87 88 |
# File 'lib/mediawiktory/wikipedia/actions/sitematrix.rb', line 86 def continue(value) merge(smcontinue: value.to_s) end |
#langprop(*values) ⇒ self
Which information about a language to return.
52 53 54 |
# 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 |
#limit(value) ⇒ self
Maximum number of results.
78 79 80 |
# File 'lib/mediawiktory/wikipedia/actions/sitematrix.rb', line 78 def limit(value) merge(smlimit: value.to_s) end |
#siteprop(*values) ⇒ self
Which information about a site to return.
65 66 67 |
# 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 |
#state(*values) ⇒ self
Filter the Site Matrix by wiki state:
39 40 41 |
# 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 |
#type(*values) ⇒ self
Filter the Site Matrix by type:
26 27 28 |
# 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 |