Module: SimpleSpreadsheets::Rendering

Included in:
Document, Document::Row, Document::Row::Cell
Defined in:
lib/simple_spreadsheets/rendering.rb

Instance Method Summary collapse

Instance Method Details

#renderObject



3
4
5
# File 'lib/simple_spreadsheets/rendering.rb', line 3

def render
  ERB.new(template).result(binding)
end

#templateObject



7
8
9
# File 'lib/simple_spreadsheets/rendering.rb', line 7

def template
  File.read(File.expand_path("../templates/#{template_file}.xml.erb", __FILE__))
end

#template_fileObject



11
12
13
# File 'lib/simple_spreadsheets/rendering.rb', line 11

def template_file
  self.class.name.demodulize.downcase
end