Class: Ea::Svg::Parity::Suite

Inherits:
Object
  • Object
show all
Defined in:
lib/ea/svg/parity/suite.rb

Overview

Drives Parity::Checker across every diagram in a Document that has a matching reference SVG. Drives from any source the Document supports (qea or xmi) since the Document is format-agnostic.

Defined Under Namespace

Classes: DiagramReport, Report

Constant Summary collapse

ELEMENT_TYPES =
%i[rect polygon path text].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document, ref_dir) ⇒ Suite

Returns a new instance of Suite.



17
18
19
20
# File 'lib/ea/svg/parity/suite.rb', line 17

def initialize(document, ref_dir)
  @document = document
  @ref_dir = ref_dir
end

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.



15
16
17
# File 'lib/ea/svg/parity/suite.rb', line 15

def document
  @document
end

#ref_dirObject (readonly)

Returns the value of attribute ref_dir.



15
16
17
# File 'lib/ea/svg/parity/suite.rb', line 15

def ref_dir
  @ref_dir
end

Instance Method Details

#measureObject



22
23
24
25
# File 'lib/ea/svg/parity/suite.rb', line 22

def measure
  per_diagram = diagrams_with_references.map { |d| measure_one(d) }
  Report.new(per_diagram: per_diagram)
end