Class: Paramedic::XMLMasseuse

Inherits:
Object
  • Object
show all
Defined in:
lib/paramedic/xml_masseuse.rb

Instance Method Summary collapse

Constructor Details

#initialize(xml, opts = {}) ⇒ XMLMasseuse



6
7
8
9
# File 'lib/paramedic/xml_masseuse.rb', line 6

def initialize(xml, opts={})
  @xml = xml
  @escape_tags = opts.fetch(:escape_tags, [])
end

Instance Method Details

#to_xmlObject



11
12
13
14
15
16
17
# File 'lib/paramedic/xml_masseuse.rb', line 11

def to_xml
  strip_tag_spacing(
    escape_specified_tags(
      Nokogiri::XML(remove_naked_ampersands(xml), &:noblanks)
    )
  )
end