Method: InlineSvg::Configuration#add_custom_transformation

Defined in:
lib/inline_svg.rb

#add_custom_transformation(options) ⇒ Object



64
65
66
67
68
69
# File 'lib/inline_svg.rb', line 64

def add_custom_transformation(options)
  if incompatible_transformation?(options.fetch(:transform))
    raise InlineSvg::Configuration::Invalid.new("#{options.fetch(:transform)} should implement the .create_with_value and #transform methods")
  end
  @custom_transformations.merge!(Hash[ *[options.fetch(:attribute, :no_attribute), options] ])
end