Class: Puree::Model::PersonName
- Defined in:
- lib/puree/model/person_name.rb
Overview
The name of a person.
Instance Attribute Summary collapse
Instance Method Summary collapse
Methods inherited from Structure
Instance Attribute Details
#first ⇒ String?
9 10 11 |
# File 'lib/puree/model/person_name.rb', line 9 def first @first end |
#last ⇒ String?
12 13 14 |
# File 'lib/puree/model/person_name.rb', line 12 def last @last end |
Instance Method Details
#first_last ⇒ String
25 26 27 |
# File 'lib/puree/model/person_name.rb', line 25 def first_last both? ? "#{first} #{last}" : 'One or both names missing' end |
#initial_last ⇒ String
35 36 37 |
# File 'lib/puree/model/person_name.rb', line 35 def initial_last both? ? "#{first[0, 1]}. #{last}" : 'One or both names missing' end |
#last_first ⇒ String
30 31 32 |
# File 'lib/puree/model/person_name.rb', line 30 def last_first both? ? "#{last}, #{first}" : 'One or both names missing' end |
#last_initial ⇒ String
40 41 42 |
# File 'lib/puree/model/person_name.rb', line 40 def last_initial both? ? "#{last}, #{first[0, 1]}." : 'One or both names missing' end |