Class: MediaWiktory::Wikipedia::Actions::Setpagelanguage
- Defined in:
- lib/mediawiktory/wikipedia/actions/setpagelanguage.rb
Overview
Changing the language of a page is not allowed on this wiki.
Usage:
api.setpagelanguage.title(value).perform # returns string with raw output
# or
api.setpagelanguage.title(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
-
#lang(value) ⇒ self
Language code of the language to change the page to.
-
#pageid(value) ⇒ self
Page ID of the page whose language you wish to change.
-
#reason(value) ⇒ self
Reason for the change.
-
#tags(*values) ⇒ self
Change tags to apply to the log entry resulting from this action.
-
#title(value) ⇒ self
Title of the page whose language you wish to change.
-
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens.
Methods inherited from Post
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
#lang(value) ⇒ self
Language code of the language to change the page to. Use default to reset the page to the wiki's default content language.
42 43 44 |
# File 'lib/mediawiktory/wikipedia/actions/setpagelanguage.rb', line 42 def lang(value) _lang(value) or fail ArgumentError, "Unknown value for lang: #{value}" end |
#pageid(value) ⇒ self
Page ID of the page whose language you wish to change. Cannot be used together with title.
34 35 36 |
# File 'lib/mediawiktory/wikipedia/actions/setpagelanguage.rb', line 34 def pageid(value) merge(pageid: value.to_s) end |
#reason(value) ⇒ self
Reason for the change.
55 56 57 |
# File 'lib/mediawiktory/wikipedia/actions/setpagelanguage.rb', line 55 def reason(value) merge(reason: value.to_s) end |
#tags(*values) ⇒ self
Change tags to apply to the log entry resulting from this action.
63 64 65 |
# File 'lib/mediawiktory/wikipedia/actions/setpagelanguage.rb', line 63 def (*values) values.inject(self) { |res, val| res.(val) or fail ArgumentError, "Unknown value for tags: #{val}" } end |
#title(value) ⇒ self
Title of the page whose language you wish to change. Cannot be used together with pageid.
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/setpagelanguage.rb', line 26 def title(value) merge(title: value.to_s) end |
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens
76 77 78 |
# File 'lib/mediawiktory/wikipedia/actions/setpagelanguage.rb', line 76 def token(value) merge(token: value.to_s) end |