Class: Pupa::Person

Inherits:
Object
  • Object
show all
Includes:
Concerns::Contactable, Concerns::Identifiable, Concerns::Linkable, Concerns::Nameable, Concerns::Sourceable, Concerns::Timestamps, Model
Defined in:
lib/pupa/models/person.rb

Overview

A real person, alive or dead.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Concerns::Linkable

#add_link, #initialize, #links=

Methods included from Concerns::Contactable

#add_contact_detail, #contact_details=, #initialize

Methods included from Concerns::Identifiable

#add_identifier, #identifiers=, #initialize

Methods included from Concerns::Nameable

#add_name, #initialize, #other_names=

Methods included from Concerns::Sourceable

#add_source, #initialize, #sources=

Methods included from Model

#==, #[], #[]=, #_id=, #add_extra, #extras=, #foreign_properties, #initialize, #to_h, #validate!

Instance Attribute Details

#additional_nameObject

Returns the value of attribute additional_name.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def additional_name
  @additional_name
end

#biographyObject

Returns the value of attribute biography.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def biography
  @biography
end

#birth_dateObject

Returns the value of attribute birth_date.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def birth_date
  @birth_date
end

#death_dateObject

Returns the value of attribute death_date.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def death_date
  @death_date
end

#emailObject

Returns the value of attribute email.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def email
  @email
end

#family_nameObject

Returns the value of attribute family_name.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def family_name
  @family_name
end

#genderObject

Returns the value of attribute gender.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def gender
  @gender
end

#given_nameObject

Returns the value of attribute given_name.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def given_name
  @given_name
end

#honorific_prefixObject

Returns the value of attribute honorific_prefix.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def honorific_prefix
  @honorific_prefix
end

#honorific_suffixObject

Returns the value of attribute honorific_suffix.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def honorific_suffix
  @honorific_suffix
end

#imageObject

Returns the value of attribute image.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def image
  @image
end

#nameObject

Returns the value of attribute name.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def name
  @name
end

#national_identityObject

Returns the value of attribute national_identity.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def national_identity
  @national_identity
end

#patronymic_nameObject

Returns the value of attribute patronymic_name.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def patronymic_name
  @patronymic_name
end

#sort_nameObject

Returns the value of attribute sort_name.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def sort_name
  @sort_name
end

#summaryObject

Returns the value of attribute summary.



15
16
17
# File 'lib/pupa/models/person.rb', line 15

def summary
  @summary
end

Instance Method Details

#fingerprintObject



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/pupa/models/person.rb', line 29

def fingerprint
  if name
    {
      '$or' => [
        {'name' => name},
        {'other_names.name' => name},
      ],
    }
  else
    {}
  end
end

#to_sString

Returns the person's name.

Returns:

  • (String)

    the person's name



23
24
25
# File 'lib/pupa/models/person.rb', line 23

def to_s
  name
end