Class: Ea::Svg::Parity::Checker
- Inherits:
-
Object
- Object
- Ea::Svg::Parity::Checker
- Defined in:
- lib/ea/svg/parity/checker.rb
Overview
Compares an emitted SVG against one EA reference SVG across element counts, font-family, viewBox, and text overlap.
Defined Under Namespace
Constant Summary collapse
- ELEMENT_TYPES =
%i[rect path polygon text group].freeze
Instance Attribute Summary collapse
-
#ours ⇒ Object
readonly
Returns the value of attribute ours.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
Instance Method Summary collapse
-
#initialize(ours:, reference:) ⇒ Checker
constructor
A new instance of Checker.
- #report ⇒ Object
Constructor Details
#initialize(ours:, reference:) ⇒ Checker
Returns a new instance of Checker.
15 16 17 18 |
# File 'lib/ea/svg/parity/checker.rb', line 15 def initialize(ours:, reference:) @ours = ours @reference = reference end |
Instance Attribute Details
#ours ⇒ Object (readonly)
Returns the value of attribute ours.
13 14 15 |
# File 'lib/ea/svg/parity/checker.rb', line 13 def ours @ours end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
13 14 15 |
# File 'lib/ea/svg/parity/checker.rb', line 13 def reference @reference end |
Instance Method Details
#report ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ea/svg/parity/checker.rb', line 20 def report Report.new( rect: count_diff("rect"), path: count_diff("path"), polygon: count_diff("polygon"), text: count_diff("text"), group: top_level_group_diff, font_family: font_family_match, view_box: view_box_match, text_overlap: text_overlap_ratio ) end |