Sha256: b869076b55fd67558056aabb23fb14a7be44f6822f94c9b81eb97fe7a0e47945

Contents?: true

Size: 895 Bytes

Versions: 8

Compression:

Stored size: 895 Bytes

Contents

module Pupa
  # A real person, alive or dead.
  class Person < Base
    self.schema = 'popolo/person'

    include Concerns::Timestamps
    include Concerns::Sourceable
    include Concerns::Nameable
    include Concerns::Identifiable
    include Concerns::Contactable
    include Concerns::Linkable

    attr_accessor :name, :family_name, :given_name, :additional_name,
      :honorific_prefix, :honorific_suffix, :patronymic_name, :sort_name,
      :email, :gender, :birth_date, :death_date, :image, :summary, :biography

    # Returns the person's name.
    #
    # @return [String] the person's name
    def to_s
      name
    end

    # @todo This will obviously need to be scoped as in Python Pupa, to a
    #  jurisdiction, post, etc.
    def fingerprint
      {
        '$or' => [
          {'name' => name},
          {'other_names.name' => name},
        ],
      }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pupa-0.0.8 lib/pupa/models/person.rb
pupa-0.0.7 lib/pupa/models/person.rb
pupa-0.0.6 lib/pupa/models/person.rb
pupa-0.0.5 lib/pupa/models/person.rb
pupa-0.0.4 lib/pupa/models/person.rb
pupa-0.0.3 lib/pupa/models/person.rb
pupa-0.0.2 lib/pupa/models/person.rb
pupa-0.0.1 lib/pupa/models/person.rb