Class: SVGPlot::SVGGradient

Inherits:
SVGTagWithParent show all
Defined in:
lib/svgplot/plot.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 SVGPlot::SVGTagWithParent

Dynamic Method Handling

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

Instance Method Details

#fillObject



609
610
611
# File 'lib/svgplot/plot.rb', line 609

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

#stop(offset, color, opacity) ⇒ Object



614
615
616
# File 'lib/svgplot/plot.rb', line 614

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