Class: Bright::Student

Inherits:
Model show all
Defined in:
lib/bright/student.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#assign_attributes, #to_json

Constructor Details

#initialize(*args) ⇒ Student

Returns a new instance of Student.



19
20
21
22
# File 'lib/bright/student.rb', line 19

def initialize(*args)
  super
  self.client_id ||= SecureRandom.uuid
end

Instance Attribute Details

#addressesObject

TODO

map contact info (addresses, email, phone, etc)



17
18
19
# File 'lib/bright/student.rb', line 17

def addresses
  @addresses
end

#contactsObject

TODO

map contact info (addresses, email, phone, etc)



17
18
19
# File 'lib/bright/student.rb', line 17

def contacts
  @contacts
end

#email_addressObject

TODO

map contact info (addresses, email, phone, etc)



17
18
19
# File 'lib/bright/student.rb', line 17

def email_address
  @email_address
end

#enrollmentObject

TODO

map contact info (addresses, email, phone, etc)



17
18
19
# File 'lib/bright/student.rb', line 17

def enrollment
  @enrollment
end

#phone_numbersObject

TODO

map contact info (addresses, email, phone, etc)



17
18
19
# File 'lib/bright/student.rb', line 17

def phone_numbers
  @phone_numbers
end

#schoolObject

TODO

map contact info (addresses, email, phone, etc)



17
18
19
# File 'lib/bright/student.rb', line 17

def school
  @school
end

Class Method Details

.attribute_namesObject



12
13
14
# File 'lib/bright/student.rb', line 12

def self.attribute_names
  @attribute_names
end

Instance Method Details

#<=>(other) ⇒ Object



28
29
30
31
32
# File 'lib/bright/student.rb', line 28

def <=>(other)
  (sis_student_id && sis_student_id == other.sis_student_id) ||
    (state_student_id && state_student_id == other.state_student_id) ||
    (first_name == other.first_name && middle_name == other.middle_name && last_name == other.last_name && birth_date == other.birth_date)
end

#nameObject



24
25
26
# File 'lib/bright/student.rb', line 24

def name
  "#{first_name} #{middle_name} #{last_name}".gsub(/\s+/, " ").strip
end