Class: Chartspec::Printer
- Inherits:
-
Object
- Object
- Chartspec::Printer
- Includes:
- ERB::Util
- Defined in:
- lib/chartspec/printer.rb
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(output) ⇒ Printer
constructor
A new instance of Printer.
- #print_html_end ⇒ Object
- #print_html_start ⇒ Object
Constructor Details
#initialize(output) ⇒ Printer
Returns a new instance of Printer.
7 8 9 |
# File 'lib/chartspec/printer.rb', line 7 def initialize(output) @output = output end |
Instance Method Details
#flush ⇒ Object
16 17 18 |
# File 'lib/chartspec/printer.rb', line 16 def flush @output.flush end |
#print_html_end ⇒ Object
20 21 22 23 |
# File 'lib/chartspec/printer.rb', line 20 def print_html_end = ERB.new File.new(File.("../../../templates/chartspec_footer.html.erb", __FILE__)).read @output.puts .result(binding) end |
#print_html_start ⇒ Object
11 12 13 14 |
# File 'lib/chartspec/printer.rb', line 11 def print_html_start chartspec_header = ERB.new File.new(File.("../../../templates/chartspec_header.html.erb", __FILE__)).read @output.puts chartspec_header.result(binding) end |