Class: Similatron::PdfComparisonEngine
Instance Method Summary
collapse
#initialize
Instance Method Details
#can_handle_mime?(mime_type) ⇒ Boolean
4
5
6
|
# File 'lib/similatron/pdf_comparison_engine.rb', line 4
def can_handle_mime?(mime_type)
mime_type =~ %r{application/pdf}
end
|
#compare(expected:, actual:) ⇒ Object
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/similatron/pdf_comparison_engine.rb', line 8
def compare(expected:, actual:)
jpg_comparison = jpg_compare(expected: expected, actual: actual)
Comparison.new(
expected: expected,
actual: actual,
score: jpg_comparison.score,
diff: jpg_comparison.diff
)
end
|