Class: Ea::Sources::Xmi::ExtensionElements

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

Overview

Walks the xmi:Extension/ block for a single EA diagram. Returns two arrays: placed elements and placed connectors, each carrying the parsed geometry + style data.

The xmi gem exposes the raw rows via Sparx::Diagram::Elements. This class adds EA-aware parsing on top.

Defined Under Namespace

Classes: PlacedConnector, PlacedElement

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(diagram) ⇒ ExtensionElements

Returns a new instance of ExtensionElements.



15
16
17
# File 'lib/ea/sources/xmi/extension_elements.rb', line 15

def initialize(diagram)
  @diagram = diagram
end

Instance Attribute Details

#diagramObject (readonly)

Returns the value of attribute diagram.



13
14
15
# File 'lib/ea/sources/xmi/extension_elements.rb', line 13

def diagram
  @diagram
end

Instance Method Details

#placed_connectorsObject



23
24
25
# File 'lib/ea/sources/xmi/extension_elements.rb', line 23

def placed_connectors
  rows.filter_map { |row| build_placed_connector(row) }
end

#placed_elementsObject



19
20
21
# File 'lib/ea/sources/xmi/extension_elements.rb', line 19

def placed_elements
  rows.filter_map { |row| build_placed_element(row) }
end