Class: MediaWiktory::Wikipedia::Actions::Echomarkread

Inherits:
Post
  • Object
show all
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

Methods inherited from Post

#perform

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

#allself

If set, marks all of a user's notifications as read.

Returns:

  • (self)


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.

Parameters:

  • values (Array<String>)

Returns:

  • (self)


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.

Parameters:

  • values (Array<String>)

    Allowed values: "alert", "message".

Returns:

  • (self)


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

Parameters:

  • value (String)

Returns:

  • (self)


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.

Parameters:

  • values (Array<String>)

Returns:

  • (self)


39
40
41
# File 'lib/mediawiktory/wikipedia/actions/echomarkread.rb', line 39

def unreadlist(*values)
  values.inject(self) { |res, val| res._unreadlist(val) }
end