Class: Ea::Sources::Xmi::NoteBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/ea/sources/xmi/note_builder.rb

Overview

Extracts Note elements from EA's XMI extension block. Notes are documentation entries (<element xmi:type="uml:Note">) inside <xmi:Extension>/<elements>. Each carries a <properties documentation="..."/> child with the body text.

The xmi gem parses Note elements as part of the extension block; we walk them and project to Ea::Model::Note.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ NoteBuilder

Returns a new instance of NoteBuilder.



18
19
20
# File 'lib/ea/sources/xmi/note_builder.rb', line 18

def initialize(root)
  @root = root
end

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



16
17
18
# File 'lib/ea/sources/xmi/note_builder.rb', line 16

def root
  @root
end

Instance Method Details

#build_allObject



22
23
24
25
26
27
# File 'lib/ea/sources/xmi/note_builder.rb', line 22

def build_all
  elements = root.extension&.elements
  return [] unless elements

  elements.element.to_a.filter_map { |e| build_one(e) }
end