Class: Inch::Badge::Image::SVG

Inherits:
Base
  • Object
show all
Defined in:
lib/inch/badge/image/svg.rb

Instance Attribute Summary

Attributes inherited from Base

#style

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Inch::Badge::Image::Base

Instance Method Details

#saveObject



7
8
9
10
11
12
13
14
15
# File 'lib/inch/badge/image/svg.rb', line 7

def save
  add_n_grade! if empty_badge?

  template_content = File.read( Config.image_path(badge_template) )
  renderer = ERB.new(template_content)
  output = renderer.result(binding)

  File.open(@filename, 'w') {|f| f.write(output) }
end