Class: Subject

Inherits:
Object
  • Object
show all
Defined in:
lib/magister/types/subject.rb

Overview

This class represents a subject in magister in the sense of when it is linked to another object

Instance Method Summary collapse

Constructor Details

#initialize(rawParsed) ⇒ Subject

Returns a new instance of Subject.

Parameters:

  • rawParsed (Hash)

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

Since:

  • 1.1.0



10
11
12
13
# File 'lib/magister/types/subject.rb', line 10

def initialize(rawParsed)
    @id = rawParsed["Id"]
    @name = rawParsed["Naam"]
end

Instance Method Details

#idInteger, String

Note:

When initialized by Grade it uses the code as the id to initialize

The id (or code) of the subject

Returns:

  • (Integer, String)

    id

See Also:

Since:

  • 1.1.0



20
21
22
# File 'lib/magister/types/subject.rb', line 20

def id
    @id
end

#nameString

Note:

When initialized by Grade it uses the description as the name to initialize

The name of the subject

Returns:

  • (String)

    Name

See Also:

Since:

  • 1.1.0



28
29
30
# File 'lib/magister/types/subject.rb', line 28

def name
    @name
end