class Bright::Student

Attributes

addresses[RW]
TODO

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

email_address[RW]
TODO

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

enrollment[RW]
TODO

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

school[RW]
TODO

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

Public Class Methods

attribute_names() click to toggle source
# File lib/bright/student.rb, line 12
def self.attribute_names
  @attribute_names
end
new(*args) click to toggle source
Calls superclass method Bright::Model::new
# File lib/bright/student.rb, line 19
def initialize(*args)
  super
  self.client_id ||= SecureRandom.uuid
  self
end

Public Instance Methods

<=>(other) click to toggle source
# 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
addresses=(array) click to toggle source
# File lib/bright/student.rb, line 37
def addresses=(array)
  if array.size <= 0 or array.first.is_a?(Address)
    @addresses = array
    @addresses.each{|a| a.student = self}
  elsif array.first.is_a?(Hash)
    @addresses = array.collect{|a| Address.new(a)}
  end
  @addresses ||= []
end
email_address=(email) click to toggle source
# File lib/bright/student.rb, line 51
def email_address=(email)
  if email.is_a?(EmailAddress)
    @email_address = email
  elsif email.is_a?(Hash)
    @email_address = EmailAddress.new(email)
  end
  @email_address
end
name() click to toggle source
# File lib/bright/student.rb, line 25
def name
  "#{self.first_name} #{self.middle_name} #{self.last_name}".gsub(/\s+/, " ").strip
end
school=(school_val) click to toggle source
# File lib/bright/student.rb, line 60
def school=(school_val)
  if school_val.is_a?(School)
    @school = school_val
  elsif school_val.is_a?(Hash)
    @school = School.new(school_val)
  end
  @school
end