class MyChart::Chart
Attributes
Public Instance Methods
generate()
click to toggle source
# File lib/my_chart.rb, line 32 def generate generate_charts generate_files end
Private Instance Methods
filled_template(tmpl_file)
click to toggle source
# File lib/my_chart.rb, line 57 def filled_template tmpl_file @filled ||= {} return @filled[tmpl_file] if @filled[tmpl_file] @filled[tmpl_file] = ERB.new(File.read tmpl_file).result(binding) end
generate_charts()
click to toggle source
# File lib/my_chart.rb, line 43 def generate_charts @chart_tags = charts.map do |id, chart| chart end end
generate_files()
click to toggle source
# File lib/my_chart.rb, line 49 def generate_files output_files and output_files.each do |path, tmpl| File.open path, 'w:utf-8' do |f| f.puts filled_template tmpl end end end