Class: MediaWiktory::Wikipedia::Actions::Enlist
- Defined in:
- lib/mediawiktory/wikipedia/actions/enlist.rb
Overview
Associate or disassociate a user as instructor or volunteer for a course.
Usage:
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 Response for working with action responses.
All action's parameters are documented as its public methods, see below.
Instance Method Summary collapse
-
#courseid(value) ⇒ self
The ID of the course.
-
#reason(value) ⇒ self
Reason for this deletion, for the log.
-
#role(value) ⇒ self
The role to affect.
-
#subaction(value) ⇒ self
Specifies what you want to do with the instructor or volunteer.
-
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens.
-
#userid(value) ⇒ self
ID of the user to associate or disassociate.
-
#username(value) ⇒ self
Name of the user to associate or disassociate.
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
#courseid(value) ⇒ self
The ID of the course.
68 69 70 |
# File 'lib/mediawiktory/wikipedia/actions/enlist.rb', line 68 def courseid(value) merge(courseid: value.to_s) end |
#reason(value) ⇒ self
Reason for this deletion, for the log.
76 77 78 |
# File 'lib/mediawiktory/wikipedia/actions/enlist.rb', line 76 def reason(value) merge(reason: value.to_s) end |
#role(value) ⇒ self
The role to affect. "instructor" for instructor, "online" for online volunteer and "campus" for campus volunteer.
39 40 41 |
# File 'lib/mediawiktory/wikipedia/actions/enlist.rb', line 39 def role(value) _role(value) or fail ArgumentError, "Unknown value for role: #{value}" end |
#subaction(value) ⇒ self
Specifies what you want to do with the instructor or volunteer.
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/enlist.rb', line 26 def subaction(value) _subaction(value) or fail ArgumentError, "Unknown value for subaction: #{value}" end |
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens
84 85 86 |
# File 'lib/mediawiktory/wikipedia/actions/enlist.rb', line 84 def token(value) merge(token: value.to_s) end |
#userid(value) ⇒ self
ID of the user to associate or disassociate.
60 61 62 |
# File 'lib/mediawiktory/wikipedia/actions/enlist.rb', line 60 def userid(value) merge(userid: value.to_s) end |
#username(value) ⇒ self
Name of the user to associate or disassociate.
52 53 54 |
# File 'lib/mediawiktory/wikipedia/actions/enlist.rb', line 52 def username(value) merge(username: value.to_s) end |