Class: SVGPlot::ChildTag
Overview
Child tag, used for tags within another tag
Instance Attribute Summary collapse
-
#img ⇒ Object
readonly
Returns the value of attribute img.
Attributes inherited from Tag
#attributes, #children, #defaults, #tag
Instance Method Summary collapse
-
#initialize(img, tag, params = {}, &block) ⇒ ChildTag
constructor
A new instance of ChildTag.
- #linear_gradient(id, attributes = {}, if_exists = :skip, &block) ⇒ Object
- #radial_gradient(id, attributes = {}, if_exists = :skip, &block) ⇒ Object
Methods inherited from Tag
#append_child, #method_missing, #path, #raw, #respond_to?, #spawn_child, #to_s, #use, #write
Methods included from Expansion
Methods included from Transform
#matrix, #rotate, #scale, #skew_x, #skew_y, #translate
Constructor Details
#initialize(img, tag, params = {}, &block) ⇒ ChildTag
Returns a new instance of ChildTag.
95 96 97 98 |
# File 'lib/svgplot/tag.rb', line 95 def initialize(img, tag, params = {}, &block) @img = img super(tag, params, &block) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SVGPlot::Tag
Instance Attribute Details
#img ⇒ Object (readonly)
Returns the value of attribute img.
93 94 95 |
# File 'lib/svgplot/tag.rb', line 93 def img @img end |
Instance Method Details
#linear_gradient(id, attributes = {}, if_exists = :skip, &block) ⇒ Object
100 101 102 |
# File 'lib/svgplot/tag.rb', line 100 def linear_gradient(id, attributes = {}, if_exists = :skip, &block) @img.add_def(id, LinearGradient.new(@img, attributes), if_exists, &block) end |
#radial_gradient(id, attributes = {}, if_exists = :skip, &block) ⇒ Object
104 105 106 |
# File 'lib/svgplot/tag.rb', line 104 def radial_gradient(id, attributes = {}, if_exists = :skip, &block) @img.add_def(id, RadialGradient.new(@img, attributes), if_exists, &block) end |