Class: Postsvg::Svg::Document
- Inherits:
-
Object
- Object
- Postsvg::Svg::Document
- Defined in:
- lib/postsvg/svg/document.rb
Overview
Root value object produced by Svg::Parser. Carries the SVG root
element, the document's viewBox / width / height (parsed once),
and the ClipPathRegistry assembled from
Instance Attribute Summary collapse
-
#clip_paths ⇒ Object
readonly
Returns the value of attribute clip_paths.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#root_element ⇒ Object
readonly
Returns the value of attribute root_element.
-
#viewbox ⇒ Object
readonly
Returns the value of attribute viewbox.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(root_element:, viewbox: nil, width: nil, height: nil, clip_paths: ClipPathRegistry.empty) ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize(root_element:, viewbox: nil, width: nil, height: nil, clip_paths: ClipPathRegistry.empty) ⇒ Document
Returns a new instance of Document.
11 12 13 14 15 16 17 18 19 |
# File 'lib/postsvg/svg/document.rb', line 11 def initialize(root_element:, viewbox: nil, width: nil, height: nil, clip_paths: ClipPathRegistry.empty) @root_element = root_element @viewbox = viewbox @width = width @height = height @clip_paths = clip_paths freeze end |
Instance Attribute Details
#clip_paths ⇒ Object (readonly)
Returns the value of attribute clip_paths.
9 10 11 |
# File 'lib/postsvg/svg/document.rb', line 9 def clip_paths @clip_paths end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
9 10 11 |
# File 'lib/postsvg/svg/document.rb', line 9 def height @height end |
#root_element ⇒ Object (readonly)
Returns the value of attribute root_element.
9 10 11 |
# File 'lib/postsvg/svg/document.rb', line 9 def root_element @root_element end |
#viewbox ⇒ Object (readonly)
Returns the value of attribute viewbox.
9 10 11 |
# File 'lib/postsvg/svg/document.rb', line 9 def viewbox @viewbox end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
9 10 11 |
# File 'lib/postsvg/svg/document.rb', line 9 def width @width end |