Class: FastExcelRails::TemplateHandler

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

Instance Method Summary collapse

Instance Method Details

#call(template, source = nil) ⇒ Object



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

def call(template, source = nil)
  "    # Only build one shared workbook object so partials can take advantage\n    # of the same workbook by default.\n    root_view = false\n    unless @fast_excel_rails_template_workbook\n      @fast_excel_rails_template_workbook = FastExcel.open\n      root_view = true\n    end\n\n    # Define a local \"workbook\" variable for accessing things inside the\n    # template.\n    workbook = @fast_excel_rails_template_workbook\n    \#{source || template.source}\n\n    if root_view\n      @fast_excel_rails_template_workbook.read_string\n    end\n  eos\nend\n"

#default_formatObject



5
6
7
# File 'lib/fast_excel_rails/template_handler.rb', line 5

def default_format
  :xlsx
end