Class: Rasem::SVGGradient

Inherits:
SVGTagWithParent show all
Defined in:
lib/rasem/svg_image.rb

Overview

SVG base gradient element, with ruby methods to describe the gradient

Direct Known Subclasses

SVGLinearGradient, SVGRadialGradient

Instance Attribute Summary

Attributes inherited from SVGTagWithParent

#img

Attributes inherited from SVGTag

#attributes, #children, #tag

Instance Method Summary collapse

Methods inherited from SVGTagWithParent

#initialize

Methods inherited from SVGTag

#append_child, #initialize, #linearGradient, #matrix, #merge_defaults, #method_missing, #path, #pop_defaults, #push_defaults, #radialGradient, #raw, #rotate, #scale, #skewX, #skewY, #spawn_child, #to_s, #translate, #use, #validate_attribute, #validate_attributes, #validate_child_name, #validate_tag, #with_style, #write, #write_points, #write_styles, #write_transforms

Constructor Details

This class inherits a constructor from Rasem::SVGTagWithParent

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Rasem::SVGTag

Instance Method Details

#fillObject



718
719
720
# File 'lib/rasem/svg_image.rb', line 718

def fill
  "url(##{@attributes[:id]})"
end

#stop(offset, color, opacity) ⇒ Object



723
724
725
# File 'lib/rasem/svg_image.rb', line 723

def stop(offset, color, opacity)
  append_child(Rasem::SVGTag.new("stop", "offset" => offset, "stop-color" => color, "stop-opacity" => opacity))
end