Class: MediaWiktory::Wikipedia::Actions::Stashedit
- Defined in:
- lib/mediawiktory/wikipedia/actions/stashedit.rb
Overview
Prepare an edit in shared cache.
Usage:
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 Response for working with action responses.
All action's parameters are documented as its public methods, see below.
Instance Method Summary collapse
-
#baserevid(value) ⇒ self
Revision ID of the base revision.
-
#contentformat(value) ⇒ self
Content serialization format used for the input text.
-
#contentmodel(value) ⇒ self
Content model of the new content.
-
#section(value) ⇒ self
Section number.
-
#sectiontitle(value) ⇒ self
The title for a new section.
-
#stashedtexthash(value) ⇒ self
Page content hash from a prior stash to use instead.
-
#summary(value) ⇒ self
Change summary.
-
#text(value) ⇒ self
Page content.
-
#title(value) ⇒ self
Title of the page being edited.
-
#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
#baserevid(value) ⇒ self
Revision ID of the base revision.
100 101 102 |
# File 'lib/mediawiktory/wikipedia/actions/stashedit.rb', line 100 def baserevid(value) merge(baserevid: value.to_s) end |
#contentformat(value) ⇒ self
Content serialization format used for the input text.
87 88 89 |
# 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) ⇒ self
Content model of the new content.
74 75 76 |
# 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) ⇒ self
Section number. 0 for the top section, new for a new section.
34 35 36 |
# File 'lib/mediawiktory/wikipedia/actions/stashedit.rb', line 34 def section(value) merge(section: value.to_s) end |
#sectiontitle(value) ⇒ self
The title for a new section.
42 43 44 |
# File 'lib/mediawiktory/wikipedia/actions/stashedit.rb', line 42 def sectiontitle(value) merge(sectiontitle: value.to_s) end |
#stashedtexthash(value) ⇒ self
Page content hash from a prior stash to use instead.
58 59 60 |
# File 'lib/mediawiktory/wikipedia/actions/stashedit.rb', line 58 def stashedtexthash(value) merge(stashedtexthash: value.to_s) end |
#summary(value) ⇒ self
Change summary.
66 67 68 |
# File 'lib/mediawiktory/wikipedia/actions/stashedit.rb', line 66 def summary(value) merge(summary: value.to_s) end |
#text(value) ⇒ self
Page content.
50 51 52 |
# File 'lib/mediawiktory/wikipedia/actions/stashedit.rb', line 50 def text(value) merge(text: value.to_s) end |
#title(value) ⇒ self
Title of the page being edited.
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/stashedit.rb', line 26 def title(value) merge(title: value.to_s) end |
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens
108 109 110 |
# File 'lib/mediawiktory/wikipedia/actions/stashedit.rb', line 108 def token(value) merge(token: value.to_s) end |