class UcbGroups::Person

Constants

ATTRIBUTE_MAPPINGS

Public Class Methods

ldap_attributes() click to toggle source
# File lib/ucb_groups/person.rb, line 26
def self.ldap_attributes
  @ldap_attributes ||= ATTRIBUTE_MAPPINGS.values.map(&:to_s)
end
new(ldap_entry) click to toggle source
# File lib/ucb_groups/person.rb, line 16
def initialize(ldap_entry)
  ATTRIBUTE_MAPPINGS.each do |attr, val|
    self.send("#{attr}=", ldap_entry[val].first.to_s) if ldap_entry[val]
  end
end

Public Instance Methods

<=>(other_person) click to toggle source
# File lib/ucb_groups/person.rb, line 38
def <=>(other_person)
  self.hash <=> other_person.hash
end
eql?(other_person) click to toggle source
# File lib/ucb_groups/person.rb, line 30
def eql?(other_person)
  self.hash == other_person.hash
end
full_name() click to toggle source
# File lib/ucb_groups/person.rb, line 22
def full_name
  [first_name, last_name].join(" ")
end
hash() click to toggle source
# File lib/ucb_groups/person.rb, line 34
def hash
  self.uid.to_i
end