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
23
# File 'lib/bright/student.rb', line 19

def initialize(*args)
  super
  self.client_id ||= SecureRandom.uuid
  self
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



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

def <=>(other)
  (self.sis_student_id and self.sis_student_id == other.sis_student_id) or
  (self.state_student_id and self.state_student_id == other.state_student_id) or
  (self.first_name == other.first_name and self.middle_name == other.middle_name and self.last_name == other.last_name and self.birth_date == other.birth_date)
end

#nameObject



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

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