Class: Approvals::Writers::XmlWriter

Inherits:
TextWriter show all
Defined in:
lib/approvals/writers/xml_writer.rb

Instance Method Summary collapse

Methods inherited from TextWriter

#write

Instance Method Details

#extensionObject



5
6
7
# File 'lib/approvals/writers/xml_writer.rb', line 5

def extension
  'xml'
end

#format(data) ⇒ Object



9
10
11
# File 'lib/approvals/writers/xml_writer.rb', line 9

def format(data)
  Nokogiri::XML(data.to_s.strip,&:noblanks).to_xml(:indent => 2, :encoding => 'UTF-8')
end