class Tilt::WriteexcelTemplate

Public Instance Methods

evaluate(scope, locals, &block) click to toggle source
Calls superclass method
# File lib/sinatra/writeexcel.rb, line 37
def evaluate(scope, locals, &block)
  blob = StringIO.new('')
  workbook = WriteExcel.new(blob)

  if data.respond_to?(:to_str)
    locals[:workbook] = workbook
    super(scope, locals, &block)
  elsif data.is_a?(Proc)
    data.call(workbook)
  end
  workbook.close
  blob.string
end
initialize_engine() click to toggle source
# File lib/sinatra/writeexcel.rb, line 29
def initialize_engine
  return if defined? ::Writeexcel::Workbook
  require_template_library 'writeexcel'
end
precompiled_template(_locals) click to toggle source
# File lib/sinatra/writeexcel.rb, line 51
def precompiled_template(_locals)
  data.to_str
end
prepare() click to toggle source
# File lib/sinatra/writeexcel.rb, line 34
def prepare
end