Class: MediaWiktory::Wikipedia::Actions::Echomarkread
- Defined in:
- lib/mediawiktory/wikipedia/actions/echomarkread.rb
Overview
Mark notifications as read for the current user.
Usage:
api.echomarkread.list(value).perform # returns string with raw output
# or
api.echomarkread.list(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
-
#all ⇒ self
If set, marks all of a user's notifications as read.
-
#list(*values) ⇒ self
A list of notification IDs to mark as read.
-
#sections(*values) ⇒ self
A list of sections to mark as read.
-
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens.
-
#unreadlist(*values) ⇒ self
A list of notification IDs to mark as unread.
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
#all ⇒ self
If set, marks all of a user's notifications as read.
51 52 53 |
# File 'lib/mediawiktory/wikipedia/actions/echomarkread.rb', line 51 def all() merge(all: 'true') end |
#list(*values) ⇒ self
A list of notification IDs to mark as read.
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/echomarkread.rb', line 26 def list(*values) values.inject(self) { |res, val| res._list(val) } end |
#sections(*values) ⇒ self
A list of sections to mark as read.
59 60 61 |
# File 'lib/mediawiktory/wikipedia/actions/echomarkread.rb', line 59 def sections(*values) values.inject(self) { |res, val| res._sections(val) or fail ArgumentError, "Unknown value for sections: #{val}" } end |
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens
72 73 74 |
# File 'lib/mediawiktory/wikipedia/actions/echomarkread.rb', line 72 def token(value) merge(token: value.to_s) end |
#unreadlist(*values) ⇒ self
A list of notification IDs to mark as unread.
39 40 41 |
# File 'lib/mediawiktory/wikipedia/actions/echomarkread.rb', line 39 def unreadlist(*values) values.inject(self) { |res, val| res._unreadlist(val) } end |