Class: WriteXlsxRails::WriteXlsxBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/write_xlsx_rails/template_handler.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(template) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/write_xlsx_rails/template_handler.rb', line 10

def self.call(template)
  "  require 'stringio'\n\n  __io = StringIO.new\n\n  __workbook_defined = defined? workbook\n  workbook = WriteXLSX.new(__io) unless __workbook_defined\n\n  {{source}}\n\n  workbook.close unless __workbook_defined\n\n  __io.flush\n  __io.string\n  TEMPLATE\nend\n".gsub(/\n/, ';').gsub('{{source}}', template.source)

Instance Method Details

#default_formatObject



6
7
8
# File 'lib/write_xlsx_rails/template_handler.rb', line 6

def default_format
  Mime::XLSX
end