Class: Edoxen::Name
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Edoxen::Name
- 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
-
#display ⇒ Object
Convenience: returns
formattedif present, else builds one from the structured components.
Instance Method Details
#display ⇒ Object
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 |