class Taxonifi::Model::Person

Simple Person class. You can store multiple initials and suffixes.

Constants

ATTRIBUTES

Public Class Methods

new(options = {}) click to toggle source
# 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

Public Instance Methods

compact_string() click to toggle source

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
display_name() click to toggle source

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
initials_string() click to toggle source

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