Class: Jekyll::Archimate::SvgFile

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/archimate/svg_file.rb

Overview

Persists an ArchiMate diagram to a file

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ SvgFile

Returns a new instance of SvgFile.



7
8
9
# File 'lib/jekyll/archimate/svg_file.rb', line 7

def initialize(filename)
  @filename = filename
end

Instance Method Details

#write(diagram) ⇒ Object



11
12
13
14
15
# File 'lib/jekyll/archimate/svg_file.rb', line 11

def write(diagram)
  File.open(@filename, "wb") do |svg_file|
    svg_file.write(::Archimate::Svg::Diagram.new(diagram).to_svg)
  end
end