Class: Roqua::Healthy::A19::NameParser
- Inherits:
-
Object
- Object
- Roqua::Healthy::A19::NameParser
show all
- Defined in:
- lib/roqua/healthy/a19/name_parser.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(message) ⇒ NameParser
Returns a new instance of NameParser.
8
9
10
|
# File 'lib/roqua/healthy/a19/name_parser.rb', line 8
def initialize(message)
@message = message
end
|
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
6
7
8
|
# File 'lib/roqua/healthy/a19/name_parser.rb', line 6
def message
@message
end
|
Instance Method Details
#display_name ⇒ Object
27
28
29
30
|
# File 'lib/roqua/healthy/a19/name_parser.rb', line 27
def display_name
return unless names[:display]
names[:display].fetch('PID.5.1')
end
|
#firstname ⇒ Object
12
13
14
15
|
# File 'lib/roqua/healthy/a19/name_parser.rb', line 12
def firstname
return unless names[:nick]
names[:nick].fetch('PID.5.2')
end
|
#initials ⇒ Object
17
18
19
|
# File 'lib/roqua/healthy/a19/name_parser.rb', line 17
def initials
"#{names[:legal].fetch('PID.5.2')} #{names[:legal].fetch('PID.5.3')}".strip
end
|
#lastname ⇒ Object
21
22
23
24
25
|
# File 'lib/roqua/healthy/a19/name_parser.rb', line 21
def lastname
prefix = names[:legal].fetch('PID.5.1').fetch('PID.5.1.2')
lastname = names[:legal].fetch('PID.5.1').fetch('PID.5.1.3')
"#{prefix} #{lastname}".strip
end
|
#nickname ⇒ Object
32
33
34
|
# File 'lib/roqua/healthy/a19/name_parser.rb', line 32
def nickname
firstname
end
|