class MediaWiktory::Wikipedia::Actions::Stashedit

Prepare an edit in shared cache.

Usage:

“`ruby api.stashedit.title(value).perform # returns string with raw output # or api.stashedit.title(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

_contentformat(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/stashedit.rb, line 92
def _contentformat(value)
  defined?(super) && super || ["application/json", "text/x-wiki", "text/javascript", "text/css", "text/plain"].include?(value.to_s) && merge(contentformat: value.to_s)
end
_contentmodel(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/stashedit.rb, line 79
def _contentmodel(value)
  defined?(super) && super || ["GadgetDefinition", "SecurePoll", "MassMessageListContent", "JsonSchema", "wikitext", "javascript", "json", "css", "text", "Scribunto"].include?(value.to_s) && merge(contentmodel: value.to_s)
end
baserevid(value) click to toggle source

Revision ID of the base revision.

@param value [Integer] @return [self]

# File lib/mediawiktory/wikipedia/actions/stashedit.rb, line 100
def baserevid(value)
  merge(baserevid: value.to_s)
end
contentformat(value) click to toggle source

Content serialization format used for the input text.

@param value [String] One of “application/json”, “text/x-wiki”, “text/javascript”, “text/css”, “text/plain”. @return [self]

# File lib/mediawiktory/wikipedia/actions/stashedit.rb, line 87
def contentformat(value)
  _contentformat(value) or fail ArgumentError, "Unknown value for contentformat: #{value}"
end
contentmodel(value) click to toggle source

Content model of the new content.

@param value [String] One of “GadgetDefinition”, “SecurePoll”, “MassMessageListContent”, “JsonSchema”, “wikitext”, “javascript”, “json”, “css”, “text”, “Scribunto”. @return [self]

# File lib/mediawiktory/wikipedia/actions/stashedit.rb, line 74
def contentmodel(value)
  _contentmodel(value) or fail ArgumentError, "Unknown value for contentmodel: #{value}"
end
section(value) click to toggle source

Section number. 0 for the top section, new for a new section.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/stashedit.rb, line 34
def section(value)
  merge(section: value.to_s)
end
sectiontitle(value) click to toggle source

The title for a new section.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/stashedit.rb, line 42
def sectiontitle(value)
  merge(sectiontitle: value.to_s)
end
stashedtexthash(value) click to toggle source

Page content hash from a prior stash to use instead.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/stashedit.rb, line 58
def stashedtexthash(value)
  merge(stashedtexthash: value.to_s)
end
summary(value) click to toggle source

Change summary.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/stashedit.rb, line 66
def summary(value)
  merge(summary: value.to_s)
end
text(value) click to toggle source

Page content.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/stashedit.rb, line 50
def text(value)
  merge(text: value.to_s)
end
title(value) click to toggle source

Title of the page being edited.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/stashedit.rb, line 26
def title(value)
  merge(title: 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/stashedit.rb, line 108
def token(value)
  merge(token: value.to_s)
end