Class: DragonflySvg::Processors::RemoveNamespaces

Inherits:
Object
  • Object
show all
Defined in:
lib/dragonfly_svg/processors/remove_namespaces.rb

Instance Method Summary collapse

Instance Method Details

#call(content) ⇒ Object

Raises:



6
7
8
9
10
11
12
13
# File 'lib/dragonfly_svg/processors/remove_namespaces.rb', line 6

def call(content)
  raise UnsupportedFormat unless content.ext
  raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)

  doc = Nokogiri::XML(content.data)
  doc.remove_namespaces!
  content.update(doc.to_xml, 'name' => 'temp.svg')
end