Class: Archimate::Svg::SvgTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/archimate/svg/svg_template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSvgTemplate

Returns a new instance of SvgTemplate.



10
11
12
# File 'lib/archimate/svg/svg_template.rb', line 10

def initialize
  @stylesheet = css_content
end

Instance Attribute Details

#stylesheetObject (readonly)

Returns the value of attribute stylesheet.



8
9
10
# File 'lib/archimate/svg/svg_template.rb', line 8

def stylesheet
  @stylesheet
end

Instance Method Details

#css_contentObject



14
15
16
# File 'lib/archimate/svg/svg_template.rb', line 14

def css_content
  @css_content ||= File.read(File.join(File.dirname(__FILE__), "archimate.css"))
end

#svg_erbObject



18
19
20
# File 'lib/archimate/svg/svg_template.rb', line 18

def svg_erb
  @svg_erb ||= File.read(File.join(File.dirname(__FILE__), "svg_template.svg.erb"))
end

#to_sObject



22
23
24
# File 'lib/archimate/svg/svg_template.rb', line 22

def to_s
  @template_xml ||= ERB.new(svg_erb).result(binding)
end