Class: Shellfie::SvgRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/shellfie/svg_renderer.rb

Instance Method Summary collapse

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