Class: Specify::Model::Agent

Inherits:
Object
  • Object
show all
Includes:
Updateable
Defined in:
lib/specify/models/agent.rb

Overview

Agents represent entities (people or organizations).

An Agent represents a Specify::Model::User in a Specify::Model::Division; that agent will be associated with every record creation and modification carried out by the user in the database.

Instance Method Summary collapse

Methods included from Updateable

#before_update

Instance Method Details

#first_nameObject

Returns a String that is the first name of a person.



110
111
112
# File 'lib/specify/models/agent.rb', line 110

def first_name
  self[:FirstName]
end

#full_name(formatter = nil) ⇒ Object

Returns a String of attributes concatanated according to the formatter.



116
117
118
119
# File 'lib/specify/models/agent.rb', line 116

def full_name(formatter = nil)
  formatter ||= "#{last_name}, #{first_name} #{middle_name}"
  formatter.strip
end

#last_nameObject

Returns a String that is the last name of a person or the name of an organization.



123
124
125
# File 'lib/specify/models/agent.rb', line 123

def last_name
  self[:LastName]
end

#middle_nameObject

Returns a String that is the middle name of a person.



128
129
130
# File 'lib/specify/models/agent.rb', line 128

def middle_name
  self[:MiddleInitial]
end

#to_sObject

Creates a string representation of self.



133
134
135
# File 'lib/specify/models/agent.rb', line 133

def to_s
  full_name
end