class MediaWiktory::Wikipedia::Actions::Enlist
Associate or disassociate a user as instructor or volunteer for a course.
Usage:
“`ruby api.enlist.subaction(value).perform # returns string with raw output # or api.enlist.subaction(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/enlist.rb, line 44 def _role(value) defined?(super) && super || ["instructor", "online", "campus", "student"].include?(value.to_s) && merge(role: value.to_s) end
@private
# File lib/mediawiktory/wikipedia/actions/enlist.rb, line 31 def _subaction(value) defined?(super) && super || ["add", "remove"].include?(value.to_s) && merge(subaction: value.to_s) end
The ID of the course.
@param value [Integer] @return [self]
# File lib/mediawiktory/wikipedia/actions/enlist.rb, line 68 def courseid(value) merge(courseid: value.to_s) end
Reason for this deletion, for the log.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/enlist.rb, line 76 def reason(value) merge(reason: value.to_s) end
The role to affect. “instructor” for instructor, “online” for online volunteer and “campus” for campus volunteer.
@param value [String] One of “instructor”, “online”, “campus”, “student”. @return [self]
# File lib/mediawiktory/wikipedia/actions/enlist.rb, line 39 def role(value) _role(value) or fail ArgumentError, "Unknown value for role: #{value}" end
Specifies what you want to do with the instructor or volunteer.
@param value [String] One of “add”, “remove”. @return [self]
# File lib/mediawiktory/wikipedia/actions/enlist.rb, line 26 def subaction(value) _subaction(value) or fail ArgumentError, "Unknown value for subaction: #{value}" end
A “csrf” token retrieved from action=query&meta=tokens
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/enlist.rb, line 84 def token(value) merge(token: value.to_s) end
ID of the user to associate or disassociate.
@param value [Integer] @return [self]
# File lib/mediawiktory/wikipedia/actions/enlist.rb, line 60 def userid(value) merge(userid: value.to_s) end
Name of the user to associate or disassociate.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/enlist.rb, line 52 def username(value) merge(username: value.to_s) end