Class: Jekyll::Archimate::SvgFile

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

Overview

Persists an ArchiMate diagram to a file

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ SvgFile

Returns a new instance of SvgFile.



162
163
164
# File 'lib/jekyll/archimate/archimate_hook.rb', line 162

def initialize(filename)
  @filename = filename
end

Instance Method Details

#write(diagram) ⇒ Object



166
167
168
169
170
# File 'lib/jekyll/archimate/archimate_hook.rb', line 166

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