Class: ReportEngine::HtmlCanvas
- Inherits:
-
Object
- Object
- ReportEngine::HtmlCanvas
- Defined in:
- lib/report_engine/html_canvas.rb
Instance Method Summary collapse
- #add_content(html) ⇒ Object
-
#initialize ⇒ HtmlCanvas
constructor
A new instance of HtmlCanvas.
- #paint(klass, options) ⇒ Object
- #render ⇒ Object
- #render_file(filename) ⇒ Object
Constructor Details
#initialize ⇒ HtmlCanvas
Returns a new instance of HtmlCanvas.
3 4 5 |
# File 'lib/report_engine/html_canvas.rb', line 3 def initialize @content = '' end |
Instance Method Details
#add_content(html) ⇒ Object
11 12 13 |
# File 'lib/report_engine/html_canvas.rb', line 11 def add_content(html) @content << html end |
#paint(klass, options) ⇒ Object
7 8 9 |
# File 'lib/report_engine/html_canvas.rb', line 7 def paint(klass, ) ReportEngine::Html.const_get(klass.to_s.camelize).new(self, ).render end |
#render ⇒ Object
15 16 17 |
# File 'lib/report_engine/html_canvas.rb', line 15 def render @content end |
#render_file(filename) ⇒ Object
19 20 21 |
# File 'lib/report_engine/html_canvas.rb', line 19 def render_file(filename) raise "Rendering HTML to a file is not possible." end |