class InlineSvg::TransformPipeline::Transformations::ClassAttribute

Public Instance Methods

transform(doc) click to toggle source
# File lib/inline_svg/transform_pipeline/transformations/class_attribute.rb, line 3
def transform(doc)
  with_svg(doc) do |svg|
    classes = (svg["class"] || "").split(" ")
    classes << value
    svg["class"] = classes.join(" ")
  end
end