Module: Ea::Sources::Xmi::IdNormalizer
- Defined in:
- lib/ea/sources/xmi/id_normalizer.rb
Overview
Normalizes XMI identifiers (xmi:id strings, often EAID_... or GUID-shaped) into stable model ids. Pass-through for real ids; synthetic ids for derived elements that have no xmi:id (annotations, waypoints).
Class Method Summary collapse
Class Method Details
.from_xmi_id(xmi_id) ⇒ Object
13 14 15 16 17 |
# File 'lib/ea/sources/xmi/id_normalizer.rb', line 13 def from_xmi_id(xmi_id) return nil if xmi_id.nil? || xmi_id.empty? xmi_id.to_s end |
.synthetic_id(owner_id, kind, suffix = nil) ⇒ Object
19 20 21 22 23 |
# File 'lib/ea/sources/xmi/id_normalizer.rb', line 19 def synthetic_id(owner_id, kind, suffix = nil) parts = ["#{owner_id}:#{kind}"] parts << suffix if suffix parts.join(":") end |