module SycLink::Exporter
Methods to export data into specific formats
Public Instance Methods
to_csv()
click to toggle source
Takes an array of row values and converts them to a csv string. Expects that the importing class is having a method rows.
# File lib/syclink/exporter.rb, line 17 def to_csv rows.map { |row| row.join(';') }.join("\n") end
to_html(template)
click to toggle source
Creates an html file based on an erb template
# File lib/syclink/exporter.rb, line 10 def to_html(template) renderer = ERB.new(template) renderer.result(binding) end