Class: MagClass

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

Constructor Details

#initialize(rawParsed) ⇒ MagClass

Returns a new instance of MagClass.

Parameters:

  • rawParsed (Hash) —

    The raw data, yet it has already been parsed (like with JSON.parse)

Since:

  • 1.1.0



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 ⇒ ?

Note:

We do not have info on what this property does/means

|?|

Returns:

  • (?)

Since:

  • 1.1.0



243
244
245
# File 'lib/magister/types/class.rb', line 243

def assignmentId
    @assignmentId
end

#attachments ⇒ ??

Note:

Unsure yet what type the attachments will be

The attachments that are attached

Returns:

  • (?, nil)

Since:

  • 1.1.0



193
194
195
# File 'lib/magister/types/class.rb', line 193

def attachments
    @attachments
end

#classEndInclusive ⇒ String

The time the class ends

Returns:

  • (String) —

    the ending date formatted in ISO 8601

Since:

  • 1.1.0



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

Returns:

Since:

  • 1.1.0



179
180
181
# File 'lib/magister/types/class.rb', line 179

def classrooms
    @classrooms
end

#classStart ⇒ String

The time the class starts

Returns:

  • (String) —

    the date formatted in ISO 8601

Since:

  • 1.1.0



77
78
79
# File 'lib/magister/types/class.rb', line 77

def classStart
    @classStart
end

#content ⇒ String?

Note:

This is stuff like homework or test descriptions.

The content of the class.

Returns:

  • (String, nil) —

    the content

Since:

  • 1.1.0



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.

Returns:

  • (String) —

    a - b - c

Since:

  • 1.1.0



109
110
111
# File 'lib/magister/types/class.rb', line 109

def description
    @description
end

#endTime ⇒ Object

See Also:

Since:

  • 1.1.0



93
94
95
# File 'lib/magister/types/class.rb', line 93

def endTime
    @classEndInclusive
end

#finished ⇒ Boolean

Note:

this has been set by the user, not by the teacher or anyone else.

If it is marked as finished

Returns:

  • (Boolean)

Since:

  • 1.1.0



147
148
149
# File 'lib/magister/types/class.rb', line 147

def finished
    @finished
end

#groups ⇒ ??

Note:

We do not have info on what this property does/means

|?|

Returns:

  • (?, nil)

Since:

  • 1.1.0



250
251
252
# File 'lib/magister/types/class.rb', line 250

def groups
    @groups
end

#hasAttachments ⇒ Boolean

If the class has any attachments

Returns:

  • (Boolean) —

    has attachments

See Also:

Since:

  • 1.1.0



186
187
188
# File 'lib/magister/types/class.rb', line 186

def hasAttachments
    @hasAttachments
end

#id ⇒ Integer

The ID of the class

Returns:

  • (Integer) —

    the id

Since:

  • 1.1.0



71
72
73
# File 'lib/magister/types/class.rb', line 71

def id
    @id
end

#infoType ⇒ ?

Note:

We do not have info on what this property does/means

|?| What kind of content it has

Returns:

  • (?)

Since:

  • 1.1.0



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.

Returns:

  • (String) —

    object summary

Since:

  • 1.1.0



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

Note:

We do not have info on what this property does/means

|?| Wether or not the class has online attendance

Returns:

  • (Boolean)

Since:

  • 1.1.0



229
230
231
# File 'lib/magister/types/class.rb', line 229

def isOnline
    @isOnline
end

#location ⇒ String

Note:

reccommended to use the classrooms property instead

The location where the class is

Returns:

  • (String) —

    the location

See Also:

Since:

  • 1.1.0



117
118
119
# File 'lib/magister/types/class.rb', line 117

def location
    @location
end

#note ⇒ String?

Note:

This is diffrent from remark

A note (aantekening) added to the class

Returns:

  • (String, nil) —

    the note

See Also:

Since:

  • 1.1.0



140
141
142
# File 'lib/magister/types/class.rb', line 140

def note
    @note
end

#remark ⇒ String?

Note:

This is diffrent form the note

A remark (opmerking) added to the class

Returns:

  • (String, nil) —

    the remark

See Also:

Since:

  • 1.1.0



132
133
134
# File 'lib/magister/types/class.rb', line 132

def remark
    @remark
end

#repeat ⇒ ?

Note:

We do not have info on what this property does/means

|?| How it repeats

Returns:

  • (?)

Since:

  • 1.1.0



161
162
163
# File 'lib/magister/types/class.rb', line 161

def repeat
    @repeat
end

#repeatStatus ⇒ Integer

Note:

Currently we are not certain what every status means.

If the class repeats

Returns:

  • (Integer) —

    the status

Since:

  • 1.1.0



154
155
156
# File 'lib/magister/types/class.rb', line 154

def repeatStatus
    @repeatStatus
end

#startTime ⇒ Object

See Also:

Since:

  • 1.1.0



82
83
84
# File 'lib/magister/types/class.rb', line 82

def startTime
    @classStart
end

#status ⇒ Integer

Note:

We do not have info on what this property does/means

|?| if the class is cancelled etc?

Returns:

  • (Integer)

Since:

  • 1.1.0



208
209
210
# File 'lib/magister/types/class.rb', line 208

def status
    @status
end

#subjects ⇒ Array<Subject>

What subjects are in this class

Returns:

  • (Array<Subject>) —

    The subjects

Since:

  • 1.1.0



167
168
169
# File 'lib/magister/types/class.rb', line 167

def subjects
    @subjects
end

#subtype ⇒ ?

Note:

We do not have info on what this property does/means

|?|

Returns:

  • (?)

Since:

  • 1.1.0



222
223
224
# File 'lib/magister/types/class.rb', line 222

def subtype
    @subtype
end

#teachers ⇒ Array<Teacher>

What teachers are giving this class

Returns:

  • (Array<Teacher>) —

    The teachers

Since:

  • 1.1.0



173
174
175
# File 'lib/magister/types/class.rb', line 173

def teachers
    @teachers
end

#type ⇒ ?

Note:

We do not have info on what this property does/means

|?|

Returns:

  • (?)

Since:

  • 1.1.0



215
216
217
# File 'lib/magister/types/class.rb', line 215

def type
    @type
end

#viewType ⇒ Integer

Note:

We do not have info on what this property does/means

|?|

Returns:

  • (Integer)

Since:

  • 1.1.0



236
237
238
# File 'lib/magister/types/class.rb', line 236

def viewType
    @viewType
end

#wholeDay ⇒ Boolean

If the class lasts the whole day

Returns:

  • (Boolean)

Since:

  • 1.1.0



99
100
101
# File 'lib/magister/types/class.rb', line 99

def wholeDay
    @wholeDay
end