Class: SVG::Canvas
- Inherits:
-
Document
- Object
- Document
- SVG::Canvas
- Includes:
- NodeHelpers
- Defined in:
- lib/svg/canvas.rb
Instance Method Summary (collapse)
-
- (Object) <<(node)
Adds the provided node to the root node.
-
- (String) [](property)
The value of the property on the root node.
-
- (Object) []=(property, value)
Sets the value of the given property on the root node.
-
- (Canvas) initialize(width, height)
constructor
A new instance of Canvas.
Methods included from NodeHelpers
#clip_path, #g, #path, #rect
Constructor Details
- (Canvas) initialize(width, height)
A new instance of Canvas
7 8 9 10 11 12 13 14 15 |
# File 'lib/svg/canvas.rb', line 7 def initialize(width, height) super() self.root = SVG::Node.new "svg", version: "1.1", xmlns: "http://www.w3.org/2000/svg", width: width, height: height end |
Instance Method Details
- (Object) <<(node)
Adds the provided node to the root node.
20 21 22 |
# File 'lib/svg/canvas.rb', line 20 def <<(node) root << node end |
- (String) [](property)
The value of the property on the root node
26 27 28 |
# File 'lib/svg/canvas.rb', line 26 def [](property) root[property] end |
- (Object) []=(property, value)
Sets the value of the given property on the root node.
34 35 36 |
# File 'lib/svg/canvas.rb', line 34 def []=(property, value) root[property] = value end |