class MediaWiktory::Wikipedia::Actions::Move
Move
a page.
Usage:
“`ruby api.move.from(value).perform # returns string with raw output # or api.move.from(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/move.rb, line 98 def _watchlist(value) defined?(super) && super || ["watch", "unwatch", "preferences", "nochange"].include?(value.to_s) && merge(watchlist: value.to_s) end
Title of the page to rename. Cannot be used together with fromid.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/move.rb, line 26 def from(value) merge(from: value.to_s) end
Page ID of the page to rename. Cannot be used together with from.
@param value [Integer] @return [self]
# File lib/mediawiktory/wikipedia/actions/move.rb, line 34 def fromid(value) merge(fromid: value.to_s) end
Ignore any warnings.
@return [self]
# File lib/mediawiktory/wikipedia/actions/move.rb, line 105 def ignorewarnings() merge(ignorewarnings: 'true') end
Rename subpages, if applicable.
@return [self]
# File lib/mediawiktory/wikipedia/actions/move.rb, line 64 def movesubpages() merge(movesubpages: 'true') end
Rename the talk page, if it exists.
@return [self]
# File lib/mediawiktory/wikipedia/actions/move.rb, line 57 def movetalk() merge(movetalk: 'true') end
Don't create a redirect.
@return [self]
# File lib/mediawiktory/wikipedia/actions/move.rb, line 71 def noredirect() merge(noredirect: 'true') end
Reason for the rename.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/move.rb, line 50 def reason(value) merge(reason: value.to_s) end
Title to rename the page to.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/move.rb, line 42 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/move.rb, line 126 def token(value) merge(token: value.to_s) end
Remove the page and the redirect from the current user's watchlist.
@return [self]
# File lib/mediawiktory/wikipedia/actions/move.rb, line 85 def unwatch() merge(unwatch: 'true') end
Add the page and the redirect to the current user's watchlist.
@return [self]
# File lib/mediawiktory/wikipedia/actions/move.rb, line 78 def watch() merge(watch: 'true') end
Unconditionally add or remove the page from the current user's watchlist, use preferences or do not change watch.
@param value [String] One of “watch”, “unwatch”, “preferences”, “nochange”. @return [self]
# File lib/mediawiktory/wikipedia/actions/move.rb, line 93 def watchlist(value) _watchlist(value) or fail ArgumentError, "Unknown value for watchlist: #{value}" end