Class: Ekuseru::TemplateHandler::Eku
- Inherits:
-
Object
- Object
- Ekuseru::TemplateHandler::Eku
- Defined in:
- lib/template_handler/eku.rb
Instance Method Summary collapse
Instance Method Details
#call(template) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/template_handler/eku.rb', line 6 def call template %{ _ekuseru_setup xls = Spreadsheet::Workbook.new #{template.source} @_ekuseru_options.set_disposition(__filename ||= nil) io = StringIO.new xls.write(io) io.rewind string = io.read string.respond_to?(:force_encoding) ? string.force_encoding(Encoding::ASCII_8BIT) : string } end |