Class: MediaWiktory::Wikipedia::Actions::Liststudents
- Defined in:
- lib/mediawiktory/wikipedia/actions/liststudents.rb
Overview
Get the usernames and other information for students enrolled in one or more courses.
Usage:
api.liststudents.courseids(value).perform # returns string with raw output
# or
api.liststudents.courseids(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
-
#courseids(*values) ⇒ self
IDs of the courses.
-
#csv ⇒ self
If given, the query will return usernames in CSV format, and it will return the articles assigned to those students.
-
#group ⇒ self
If given, the query will group students by course.
-
#prop(value) ⇒ self
Which property to get for each student:.
Methods inherited from Get
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
#courseids(*values) ⇒ self
IDs of the courses.
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/liststudents.rb', line 26 def courseids(*values) values.inject(self) { |res, val| res._courseids(val) } end |
#csv ⇒ self
If given, the query will return usernames in CSV format, and it will return the articles assigned to those students.
58 59 60 |
# File 'lib/mediawiktory/wikipedia/actions/liststudents.rb', line 58 def csv() merge(csv: 'true') end |
#group ⇒ self
If given, the query will group students by course.
51 52 53 |
# File 'lib/mediawiktory/wikipedia/actions/liststudents.rb', line 51 def group() merge(group: 'true') end |
#prop(value) ⇒ self
Which property to get for each student:
39 40 41 |
# File 'lib/mediawiktory/wikipedia/actions/liststudents.rb', line 39 def prop(value) _prop(value) or fail ArgumentError, "Unknown value for prop: #{value}" end |