Class: Shellfie::SvgRenderer
- Inherits:
-
Object
- Object
- Shellfie::SvgRenderer
- Defined in:
- lib/shellfie/svg_renderer.rb
Instance Method Summary collapse
-
#initialize(config:, theme:) ⇒ SvgRenderer
constructor
A new instance of SvgRenderer.
- #render(geometry, output_path, transparent: false) ⇒ Object
- #to_svg(geometry, transparent: false) ⇒ Object
Constructor Details
#initialize(config:, theme:) ⇒ SvgRenderer
Returns a new instance of SvgRenderer.
8 9 10 11 |
# File 'lib/shellfie/svg_renderer.rb', line 8 def initialize(config:, theme:) @config = config @theme = theme end |
Instance Method Details
#render(geometry, output_path, transparent: false) ⇒ Object
13 14 15 |
# File 'lib/shellfie/svg_renderer.rb', line 13 def render(geometry, output_path, transparent: false) File.write(output_path, to_svg(geometry, transparent: transparent)) end |
#to_svg(geometry, transparent: false) ⇒ Object
17 18 19 |
# File 'lib/shellfie/svg_renderer.rb', line 17 def to_svg(geometry, transparent: false) document(geometry, transparent: transparent) end |