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
@private
# 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
@private
# 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
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
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
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 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
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
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
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
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 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
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