Class: ReportEngine::HtmlCanvas

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

Instance Method Summary collapse

Constructor Details

#initializeHtmlCanvas

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, options)
  ReportEngine::Html.const_get(klass.to_s.camelize).new(self, options).render
end

#renderObject



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