Class: Edoxen::Name

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

Overview

Structured personal/organisational name. VCARD conventions (RFC 6350): separate structured components (N) from a pre-formatted display string (FN). Either or both may be populated.

formatted is the display string when callers have it pre-built; the structured fields (family, given, additional, prefix, suffix) let adopters store parsed components for sorting, indexing, or locale-aware rendering.

Instance Method Summary collapse

Instance Method Details

#displayObject

Convenience: returns formatted if present, else builds one from the structured components. Useful for callers that always want a display string regardless of how the name was authored.



24
25
26
27
# File 'lib/edoxen/name.rb', line 24

def display
  formatted || [prefix, given, additional, family, suffix]
    .reject { |s| s.to_s.empty? }.join(" ")
end