Class: Osheet::TiltHandler

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/osheet/view_handler/tilt.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.engine_initialized?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/osheet/view_handler/tilt.rb', line 5

def self.engine_initialized?
  defined? ::Osheet::Workbook
end

Instance Method Details

#initialize_engineObject



9
10
11
# File 'lib/osheet/view_handler/tilt.rb', line 9

def initialize_engine
  require_template_library 'osheet'
end

#precompiled_postamble(locals) ⇒ Object



22
23
24
# File 'lib/osheet/view_handler/tilt.rb', line 22

def precompiled_postamble(locals)
  "}.to_data"
end

#precompiled_preamble(locals) ⇒ Object



15
16
17
# File 'lib/osheet/view_handler/tilt.rb', line 15

def precompiled_preamble(locals)
  "::Osheet::Workbook.new {\n#{super}"
end

#precompiled_template(locals) ⇒ Object



19
20
21
# File 'lib/osheet/view_handler/tilt.rb', line 19

def precompiled_template(locals)
  data.to_str
end

#prepareObject



13
# File 'lib/osheet/view_handler/tilt.rb', line 13

def prepare; end