Class: Ea::Sources::Qea::NoteBuilder

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

Overview

Extracts Note elements from EA's t_object table. Notes have object_type="Note" and are filtered out by ClassifierBuilder. Their body text lives in t_object.Note; the diagram renderer emits them as dog-eared rects with the body wrapped inside.

Text elements (object_type="Text") with LegendOpts= in StyleEx are auto-generated legend blocks rather than notes; their configuration is parsed from t_xref and attached as an Ea::Model::Legend payload on the Note.

Constant Summary collapse

NOTE_OBJECT_TYPE =
"Note".freeze
TEXT_OBJECT_TYPE =
"Text".freeze
LEGEND_STYLEEX_TOKEN =
"LegendOpts=".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(database) ⇒ NoteBuilder

Returns a new instance of NoteBuilder.



22
23
24
# File 'lib/ea/sources/qea/note_builder.rb', line 22

def initialize(database)
  @database = database
end

Instance Attribute Details

#databaseObject (readonly)

Returns the value of attribute database.



20
21
22
# File 'lib/ea/sources/qea/note_builder.rb', line 20

def database
  @database
end

Instance Method Details

#build_allObject



26
27
28
29
# File 'lib/ea/sources/qea/note_builder.rb', line 26

def build_all
  objects = database.collections[:objects] || []
  objects.filter_map { |obj| build_one(obj) }
end