Class: RexleDiff

Inherits:
Object
  • Object
show all
Defined in:
lib/rexle-diff.rb

Defined Under Namespace

Classes: HashedDoc

Instance Method Summary collapse

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

#changedObject Also known as: updated



75
76
77
# File 'lib/rexle-diff.rb', line 75

def changed()
  @doc.root.xpath('*[@last_modified]')
end

#createdObject



81
82
83
# File 'lib/rexle-diff.rb', line 81

def created()
  @doc.root.xpath('*[@created]')
end

#to_docObject



85
86
87
# File 'lib/rexle-diff.rb', line 85

def to_doc()
  @doc
end