Class: Specify::Model::Agent

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

Instance Method Summary collapse

Instance Method Details

#before_saveObject



101
102
103
104
105
# File 'lib/specify/models/agent.rb', line 101

def before_save
  self.Version += 1
  self.TimestampModified = Time.now
  super
end

#first_nameObject



107
108
109
# File 'lib/specify/models/agent.rb', line 107

def first_name
  self.FirstName
end

#full_name(formatter = nil) ⇒ Object



119
120
121
122
# File 'lib/specify/models/agent.rb', line 119

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

#last_nameObject



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

def last_name
  self.LastName
end

#middle_nameObject



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

def middle_name
  self.MiddleInitial
end

#to_sObject



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

def to_s
  full_name
end