Class: InlineSvg::TransformPipeline::Transformations::Width
- Inherits:
-
Transformation
- Object
- Transformation
- InlineSvg::TransformPipeline::Transformations::Width
- Defined in:
- lib/inline_svg/transform_pipeline/transformations/width.rb
Instance Attribute Summary
Attributes inherited from Transformation
Instance Method Summary collapse
Methods inherited from Transformation
create_with_value, #initialize
Constructor Details
This class inherits a constructor from InlineSvg::TransformPipeline::Transformations::Transformation
Instance Method Details
#transform(doc) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/inline_svg/transform_pipeline/transformations/width.rb', line 3 def transform(doc) doc = Nokogiri::XML::Document.parse(doc.to_html) svg = doc.at_css 'svg' svg['width'] = self.value doc end |