Class: Archimate::Svg::SvgTemplate
- Inherits:
-
Object
- Object
- Archimate::Svg::SvgTemplate
- Defined in:
- lib/archimate/svg/svg_template.rb
Instance Attribute Summary collapse
-
#stylesheet ⇒ Object
readonly
Returns the value of attribute stylesheet.
Instance Method Summary collapse
- #css_content ⇒ Object
-
#initialize ⇒ SvgTemplate
constructor
A new instance of SvgTemplate.
- #svg_erb ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ SvgTemplate
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
#stylesheet ⇒ Object (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_content ⇒ Object
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_erb ⇒ Object
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_s ⇒ Object
22 23 24 |
# File 'lib/archimate/svg/svg_template.rb', line 22 def to_s @template_xml ||= ERB.new(svg_erb).result(binding) end |