Class: RexleDiff
- Inherits:
-
Object
- Object
- RexleDiff
- Defined in:
- lib/rexle-diff.rb
Defined Under Namespace
Classes: HashedDoc
Instance Method Summary collapse
- #changed ⇒ Object (also: #updated)
- #created ⇒ Object
-
#initialize(source1, source2, fuzzy_match: false) ⇒ RexleDiff
constructor
A new instance of RexleDiff.
- #to_doc ⇒ Object
Constructor Details
#initialize(source1, source2, fuzzy_match: false) ⇒ RexleDiff
Returns a new instance of RexleDiff.
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/rexle-diff.rb', line 63 def initialize(source1, source2, fuzzy_match: false) @fuzzy_match = fuzzy_match doc1, doc2 = HashedDoc.new(Rexle.new(source1).root).to_doc, HashedDoc.new(Rexle.new(source2).root).to_doc compare(doc1.root, doc2.root) @doc = doc2 end |
Instance Method Details
#changed ⇒ Object Also known as: updated
75 76 77 |
# File 'lib/rexle-diff.rb', line 75 def changed() @doc.root.xpath('*[@last_modified]') end |
#created ⇒ Object
81 82 83 |
# File 'lib/rexle-diff.rb', line 81 def created() @doc.root.xpath('*[@created]') end |
#to_doc ⇒ Object
85 86 87 |
# File 'lib/rexle-diff.rb', line 85 def to_doc() @doc end |