Class: XmlPatch::Applicator

Inherits:
Object
  • Object
show all
Defined in:
lib/xml_patch/applicator.rb

Instance Method Summary collapse

Constructor Details

#initialize(patch) ⇒ Applicator

Returns a new instance of Applicator.



6
7
8
# File 'lib/xml_patch/applicator.rb', line 6

def initialize(patch)
  @patch = patch
end

Instance Method Details

#to(target_xml) ⇒ Object



10
11
12
13
14
# File 'lib/xml_patch/applicator.rb', line 10

def to(target_xml)
  target = XmlPatch::XmlDocument.new(target_xml)
  diff_document.apply_to(target)
  target.to_xml
end