Class: DragonflySvg::Processors::SetPreserveAspectRatio

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

Instance Method Summary collapse

Instance Method Details

#call(content, value = 'xMinYMin meet') ⇒ Object

Raises:



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

def call(content, value = 'xMinYMin meet')
  raise UnsupportedFormat unless content.ext
  raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)

  SetAttribute.new.call(content, "//*[name()='svg']", 'preserveAspectRatio', value)
end