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

_tags(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/move.rb, line 118
def _tags(value)
  defined?(super) && super || ["ProveIt edit", "WPCleaner", "huggle", "large plot addition"].include?(value.to_s) && merge(tags: value.to_s, replace: false)
end
_watchlist(value) click to toggle source

@private

Calls superclass method
# 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
from(value) click to toggle source

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
fromid(value) click to toggle source

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
ignorewarnings() click to toggle source

Ignore any warnings.

@return [self]

# File lib/mediawiktory/wikipedia/actions/move.rb, line 105
def ignorewarnings()
  merge(ignorewarnings: 'true')
end
movesubpages() click to toggle source

Rename subpages, if applicable.

@return [self]

# File lib/mediawiktory/wikipedia/actions/move.rb, line 64
def movesubpages()
  merge(movesubpages: 'true')
end
movetalk() click to toggle source

Rename the talk page, if it exists.

@return [self]

# File lib/mediawiktory/wikipedia/actions/move.rb, line 57
def movetalk()
  merge(movetalk: 'true')
end
noredirect() click to toggle source

Don't create a redirect.

@return [self]

# File lib/mediawiktory/wikipedia/actions/move.rb, line 71
def noredirect()
  merge(noredirect: 'true')
end
reason(value) click to toggle source

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
tags(*values) click to toggle source

Change tags to apply to the entry in the move log and to the null revision on the destination page.

@param values [Array<String>] Allowed values: “ProveIt edit”, “WPCleaner”, “huggle”, “large plot addition”. @return [self]

# File lib/mediawiktory/wikipedia/actions/move.rb, line 113
def tags(*values)
  values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, "Unknown value for tags: #{val}" }
end
to(value) click to toggle source

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
token(value) click to toggle source

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
unwatch() click to toggle source

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
watch() click to toggle source

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
watchlist(value) click to toggle source

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