Class: Edoxen::Contact

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/edoxen/contact.rb

Overview

VCARD-like abstract contact. Generalises Person for cases where the contact may be a person, an organisation, a department, a role ("Secretariat"), or any other entity with a name and one or more communication channels.

1.0 (per-field localization, ISO 24229):

- All translatable fields are Localized<String/Name>[0..*]
(one entry per spelling/conversion system code).
- Added: `urn` for registry storage; `ref` for reference-by-URN.

Reference vs inline: when ref is set, treat this Contact as a reference (other fields ignored). When ref is unset, the Contact is inline (full data). Both patterns are valid on every field that accepts a Contact.

Instance Method Summary collapse

Instance Method Details

#local_lookup_keyObject

Key used to resolve a local_ref against a document-scoped collection (e.g. Meeting#contacts). Contacts are keyed by urn.



39
40
41
# File 'lib/edoxen/contact.rb', line 39

def local_lookup_key
  urn
end

#reference?Boolean

Returns:

  • (Boolean)


32
33
34
35
# File 'lib/edoxen/contact.rb', line 32

def reference?
  (!ref.nil? && !ref.to_s.empty?) ||
    (!local_ref.nil? && !local_ref.to_s.empty?)
end