Comparison API - p0deje/groupdocs-ruby GitHub Wiki

Get document details

document = GroupDocs::Document.find!(:name, 'CV.doc')
document.details!
#=> { guid: 'ae95y42q7yhwd9ufh9s', name: 'CV.doc', supported: true }

Compare one document with other

document_one = GroupDocs::Document.find!(:name, 'CV.doc')
document_two = GroupDocs::Document.find!(:name, 'Resume.doc')
document_one.compare!(document_two)
#=> #<GroupDocs::Job:0x0000000171f448 @id=123> 

Get comparison changes

document_one = GroupDocs::Document.find!(:name, 'CV.doc')
document_two = GroupDocs::Document.find!(:name, 'Resume.doc')
job = document_one.compare!(document_two)
result = job.documents!.first
result.changes!
#=> [#<GroupDocs::Document::Change:0x00000002614f70 @id=1, @type=:delete, @box=#<GroupDocs::Document::Rectangle:0x00000002614a20>, @text="This part was deleted">, #<GroupDocs::Document::Change:0x00000002614228 @id=2, @type=:insert, @box=#<GroupDocs::Document::Rectangle:0x00000002613a30>, @text="This part was inserted">]