Class: Report
- Inherits:
-
Object
- Object
- Report
- Defined in:
- lib/rubbyReport.rb
Instance Method Summary collapse
-
#initialize(page, data = {}) ⇒ Report
constructor
A new instance of Report.
- #render ⇒ Object
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
#render ⇒ Object
43 44 45 |
# File 'lib/rubbyReport.rb', line 43 def render ERB.new(@template).result(binding) end |