Simple Person class. You can store multiple initials and suffixes.
# File lib/models/person.rb, line 20 def initialize(options = {}) opts = { }.merge!(options) # Check for valid opts prior to building build(ATTRIBUTES, opts) true end
Returns a string with data delimited by pipes. Used in identity comparisons.
# File lib/models/person.rb, line 30 def compact_string s = [ATTRIBUTES.sort.collect{|a| send(a)}].join("|").downcase.gsub(%r\s/, '') end
Nothing fancy, just the data.
# File lib/models/person.rb, line 35 def display_name [@last_name, @first_name, @initials, @suffix].compact.flatten.join(" ") end
Return a string representing the initials, periods added.
# File lib/models/person.rb, line 40 def initials_string if @initials.nil? nil else @initials.join(".") + "." end end