Class: MagClass
- Inherits:
-
Object
- Object
- MagClass
- Defined in:
- lib/magister/types/class.rb
Overview
This class describes a Class as it would appear in the schedule in magister. MagClass instead of Class becasue ruby got confused with class
Instance Method Summary collapse
-
#assignmentId ⇒ ?
|?|.
-
#attachments ⇒ ??
The attachments that are attached.
-
#classEndInclusive ⇒ String
The time the class ends.
-
#classrooms ⇒ Array<ClassRoom>
What classrooms this class is given in.
-
#classStart ⇒ String
The time the class starts.
-
#content ⇒ String?
The content of the class.
-
#description ⇒ String
The description of the class formatted like a - b - c.
- #endTime ⇒ Object
-
#finished ⇒ Boolean
If it is marked as finished.
-
#groups ⇒ ??
|?|.
-
#hasAttachments ⇒ Boolean
If the class has any attachments.
-
#id ⇒ Integer
The ID of the class.
-
#infoType ⇒ ?
|?| What kind of content it has.
-
#initialize(rawParsed) ⇒ MagClass
constructor
Returns a new instance of MagClass.
-
#inspect ⇒ String
Gets a summary of the object.
-
#isOnline ⇒ Boolean
|?| Wether or not the class has online attendance.
-
#location ⇒ String
The location where the class is.
-
#note ⇒ String?
A note (aantekening) added to the class.
-
#remark ⇒ String?
A remark (opmerking) added to the class.
-
#repeat ⇒ ?
|?| How it repeats.
-
#repeatStatus ⇒ Integer
If the class repeats.
- #startTime ⇒ Object
-
#status ⇒ Integer
|?| if the class is cancelled etc?.
-
#subjects ⇒ Array<Subject>
What subjects are in this class.
-
#subtype ⇒ ?
|?|.
-
#teachers ⇒ Array<Teacher>
What teachers are giving this class.
-
#type ⇒ ?
|?|.
-
#viewType ⇒ Integer
|?|.
-
#wholeDay ⇒ Boolean
If the class lasts the whole day.
Constructor Details
#initialize(rawParsed) ⇒ MagClass
Returns a new instance of MagClass.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/magister/types/class.rb', line 14 def initialize(rawParsed) @id = rawParsed["Id"] @classStart = rawParsed["Start"] @classEndInclusive = rawParsed["Einde"] @wholeDay = rawParsed["DuurtHeleDag"] @description = rawParsed["Omschrijving"] # I dont know why location is here when theres also classrooms @location = rawParsed["Lokatie"] @content = rawParsed["Inhoud"] @remark = rawParsed["Opmerking"] @note = rawParsed["Aantekening"] @finished = rawParsed["Afgerond"] @repeatStatus = rawParsed["HerhaalStatus"] @repeat = rawParsed["Herhaling"] @subjects = Array.new rawParsed["Vakken"].each do |subject| @subjects.push Subject.new(subject) end @teachers = Array.new rawParsed["Docenten"].each do |teacher| @teachers.push Teacher.new(teacher) end @classrooms = Array.new rawParsed["Lokalen"].each do |classRoom| @classrooms.push ClassRoom.new(classRoom) end @hasAttachments = rawParsed["HeeftBijlagen"] @attachments = rawParsed["Bijlagen"] # I dont know what these values do @infoType = rawParsed["InfoType"] # I think what kind of content like homework/test @status = rawParsed["Status"] # I think the status as in cancelled @type = rawParsed["Type"] @subtype = rawParsed["SubType"] @isOnline = rawParsed["IsOnlineDeelname"] # Wether there is a way to participate online? @viewType = rawParsed["WeergaveType"] @assignmentId = rawParsed["OpdrachtId"] @groups = rawParsed["Groepen"] end |
Instance Method Details
#assignmentId ⇒ ?
We do not have info on what this property does/means
|?|
243 244 245 |
# File 'lib/magister/types/class.rb', line 243 def assignmentId @assignmentId end |
#attachments ⇒ ??
Unsure yet what type the attachments will be
The attachments that are attached
193 194 195 |
# File 'lib/magister/types/class.rb', line 193 def @attachments end |
#classEndInclusive ⇒ String
The time the class ends
88 89 90 |
# File 'lib/magister/types/class.rb', line 88 def classEndInclusive @classEndInclusive end |
#classrooms ⇒ Array<ClassRoom>
What classrooms this class is given in
179 180 181 |
# File 'lib/magister/types/class.rb', line 179 def classrooms @classrooms end |
#classStart ⇒ String
The time the class starts
77 78 79 |
# File 'lib/magister/types/class.rb', line 77 def classStart @classStart end |
#content ⇒ String?
This is stuff like homework or test descriptions.
The content of the class.
124 125 126 |
# File 'lib/magister/types/class.rb', line 124 def content @content end |
#description ⇒ String
The description of the class formatted like a - b - c. where a is a short version of the classes name. where b is the short code of the teachers name. where c is the class/group the class belongs to.
109 110 111 |
# File 'lib/magister/types/class.rb', line 109 def description @description end |
#endTime ⇒ Object
93 94 95 |
# File 'lib/magister/types/class.rb', line 93 def endTime @classEndInclusive end |
#finished ⇒ Boolean
this has been set by the user, not by the teacher or anyone else.
If it is marked as finished
147 148 149 |
# File 'lib/magister/types/class.rb', line 147 def finished @finished end |
#groups ⇒ ??
We do not have info on what this property does/means
|?|
250 251 252 |
# File 'lib/magister/types/class.rb', line 250 def groups @groups end |
#hasAttachments ⇒ Boolean
If the class has any attachments
186 187 188 |
# File 'lib/magister/types/class.rb', line 186 def hasAttachments @hasAttachments end |
#id ⇒ Integer
The ID of the class
71 72 73 |
# File 'lib/magister/types/class.rb', line 71 def id @id end |
#infoType ⇒ ?
We do not have info on what this property does/means
|?| What kind of content it has
201 202 203 |
# File 'lib/magister/types/class.rb', line 201 def infoType @infoType end |
#inspect ⇒ String
Gets a summary of the object. Overwrites default function.
62 63 64 |
# File 'lib/magister/types/class.rb', line 62 def inspect "#<#{self.class}:0x#{object_id} @id=#{@id}, @description=#{@description}, @subjects[0]=#{@subjects[0].inspect}, @teachers[0]=#{@teachers[0].inspect}, @location=#{@location}>" end |
#isOnline ⇒ Boolean
We do not have info on what this property does/means
|?| Wether or not the class has online attendance
229 230 231 |
# File 'lib/magister/types/class.rb', line 229 def isOnline @isOnline end |
#location ⇒ String
reccommended to use the classrooms
property instead
The location where the class is
117 118 119 |
# File 'lib/magister/types/class.rb', line 117 def location @location end |
#note ⇒ String?
This is diffrent from remark
A note (aantekening) added to the class
140 141 142 |
# File 'lib/magister/types/class.rb', line 140 def note @note end |
#remark ⇒ String?
This is diffrent form the note
A remark (opmerking) added to the class
132 133 134 |
# File 'lib/magister/types/class.rb', line 132 def remark @remark end |
#repeat ⇒ ?
We do not have info on what this property does/means
|?| How it repeats
161 162 163 |
# File 'lib/magister/types/class.rb', line 161 def repeat @repeat end |
#repeatStatus ⇒ Integer
Currently we are not certain what every status means.
If the class repeats
154 155 156 |
# File 'lib/magister/types/class.rb', line 154 def repeatStatus @repeatStatus end |
#startTime ⇒ Object
82 83 84 |
# File 'lib/magister/types/class.rb', line 82 def startTime @classStart end |
#status ⇒ Integer
We do not have info on what this property does/means
|?| if the class is cancelled etc?
208 209 210 |
# File 'lib/magister/types/class.rb', line 208 def status @status end |
#subjects ⇒ Array<Subject>
What subjects are in this class
167 168 169 |
# File 'lib/magister/types/class.rb', line 167 def subjects @subjects end |
#subtype ⇒ ?
We do not have info on what this property does/means
|?|
222 223 224 |
# File 'lib/magister/types/class.rb', line 222 def subtype @subtype end |
#teachers ⇒ Array<Teacher>
What teachers are giving this class
173 174 175 |
# File 'lib/magister/types/class.rb', line 173 def teachers @teachers end |
#type ⇒ ?
We do not have info on what this property does/means
|?|
215 216 217 |
# File 'lib/magister/types/class.rb', line 215 def type @type end |
#viewType ⇒ Integer
We do not have info on what this property does/means
|?|
236 237 238 |
# File 'lib/magister/types/class.rb', line 236 def viewType @viewType end |
#wholeDay ⇒ Boolean
If the class lasts the whole day
99 100 101 |
# File 'lib/magister/types/class.rb', line 99 def wholeDay @wholeDay end |