Class: Specify::Model::Agent
- Inherits:
-
Object
- Object
- Specify::Model::Agent
- 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
-
#first_name ⇒ Object
Returns a String that is the first name of a person.
-
#full_name(formatter = nil) ⇒ Object
Returns a String of attributes concatanated according to the
formatter. -
#last_name ⇒ Object
Returns a String that is the last name of a person or the name of an organization.
-
#middle_name ⇒ Object
Returns a String that is the middle name of a person.
-
#to_s ⇒ Object
Creates a string representation of
self.
Methods included from Updateable
Instance Method Details
#first_name ⇒ Object
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_name ⇒ Object
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_name ⇒ Object
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_s ⇒ Object
Creates a string representation of self.
133 134 135 |
# File 'lib/specify/models/agent.rb', line 133 def to_s full_name end |