Class: Report

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

Instance Method Summary collapse

Constructor Details

#initialize(page, data = {}) ⇒ Report

Returns a new instance of Report.



36
37
38
39
40
41
# File 'lib/rubbyReport.rb', line 36

def initialize(page, data = {})
  @data = data
  @page = page
  file = File.join(File.dirname(__FILE__), "./templates/#{page}.html.erb")
  @template = File.read(file)
end

Instance Method Details

#renderObject



43
44
45
# File 'lib/rubbyReport.rb', line 43

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