module MediaWiktory::Wikipedia::Modules::Contenttranslation
Query Content Translation database for translations.
The “submodule” (MediaWiki API term) is included in action after setting some param, providing additional tweaking for this param. Example (for {MediaWiktory::Wikipedia::Actions::Query} and its submodules):
“`ruby 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.
Public Instance Methods
@private
# File lib/mediawiktory/wikipedia/modules/contenttranslation.rb, line 78 def _type(value) defined?(super) && super || ["draft", "published"].include?(value.to_s) && merge(type: value.to_s) end
The source language code.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/modules/contenttranslation.rb, line 33 def from(value) merge(from: value.to_s) end
The maximum number of translations to fetch.
@param value [Integer, “max”] @return [self]
# File lib/mediawiktory/wikipedia/modules/contenttranslation.rb, line 57 def limit(value) merge(limit: value.to_s) end
Offset into result set (optional).
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/modules/contenttranslation.rb, line 65 def offset(value) merge(offset: value.to_s) end
The title of the source page.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/modules/contenttranslation.rb, line 49 def sourcetitle(value) merge(sourcetitle: value.to_s) end
The target language code.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/modules/contenttranslation.rb, line 41 def to(value) merge(to: value.to_s) end
Translation ID.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/modules/contenttranslation.rb, line 25 def translationid(value) merge(translationid: value.to_s) end
State of the translation.
@param value [String] One of “draft”, “published”. @return [self]
# File lib/mediawiktory/wikipedia/modules/contenttranslation.rb, line 73 def type(value) _type(value) or fail ArgumentError, "Unknown value for type: #{value}" end