Class: Person

Inherits:
Object
  • Object
show all
Includes:
Birth, Official
Defined in:
lib/magister/types/person.rb

Overview

This class describes the person object the magister api gives us this object includes all the user’s personal data like name and birthday

Instance Method Summary collapse

Methods included from Official

#firstNames, #prepositions

Methods included from Birth

#day, #use

Constructor Details

#initialize(rawParsed) ⇒ Person

Returns a new instance of Person.

Parameters:

  • rawParsed (Hash)

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

Since:

  • 1.2.0



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/magister/types/person.rb', line 78

def initialize(rawParsed)
    @id                     = rawParsed["Id"]
    @firstName              = rawParsed["Roepnaam"]
    @preposition            = rawParsed["Tussenvoegsel"]
    @lastName               = rawParsed["Achternaam"]
    @officialFirstNames     = rawParsed["OfficieleVoornamen"]
    @initials               = rawParsed["Voorletters"]
    @officialPrepositions   = rawParsed["OfficieleTussenvoegsels"]
    @officialLastName       = rawParsed["OfficieleAchternaam"]
    @birthDay               = rawParsed["Geboortedatum"]
    @birthLastName          = rawParsed["GeboorteAchternaam"]
    @birthnamePreposition   = rawParsed["GeboortenaamTussenvoegsel"]
    @useBirthname           = rawParsed["GebruikGeboortenaam"]

    # probably only for tracking
    @externalId             = rawParsed["ExterneId"]
end

Instance Method Details

#birthDayString

The birthday of the person

Returns:

  • (String)

    birthday

Since:

  • 1.2.0



129
130
131
# File 'lib/magister/types/person.rb', line 129

def birthDay
    @birthDay
end

#firstNameString

The first name of the person

Returns:

  • (String)

    name

Since:

  • 1.2.0



105
106
107
# File 'lib/magister/types/person.rb', line 105

def firstName
    @firstName
end

#idInteger

The id of the person

Returns:

  • (Integer)

    id

Since:

  • 1.2.0



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

def id
    @id
end

#initialsString

The initials of the person

Returns:

  • (String)

    initials

Since:

  • 1.2.0



123
124
125
# File 'lib/magister/types/person.rb', line 123

def initials
    @initials
end

#lastNameString

The last name of the person

Returns:

  • (String)

    name

Since:

  • 1.2.0



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

def lastName
    @lastName
end

#prepositionString?

The preposition (thing between first & last name) of the person

Returns:

  • (String, nil)

    preposition

Since:

  • 1.2.0



111
112
113
# File 'lib/magister/types/person.rb', line 111

def preposition
    @preposition
end

#useBirthnameBoolean

Wether or not to use the users birth name

Returns:

  • (Boolean)

    use birth name

Since:

  • 1.2.0



135
136
137
# File 'lib/magister/types/person.rb', line 135

def useBirthname
    @useBirthname
end