Class: HtmlMxmlcErrorFormatter
- Inherits:
-
Object
- Object
- HtmlMxmlcErrorFormatter
- Defined in:
- lib/formatters/html_mxmlc_error_formatter.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#out ⇒ Object
readonly
Returns the value of attribute out.
Instance Method Summary collapse
- #format! ⇒ Object
-
#initialize(errors, template = nil) ⇒ HtmlMxmlcErrorFormatter
constructor
A new instance of HtmlMxmlcErrorFormatter.
Constructor Details
#initialize(errors, template = nil) ⇒ HtmlMxmlcErrorFormatter
Returns a new instance of HtmlMxmlcErrorFormatter.
8 9 10 11 12 |
# File 'lib/formatters/html_mxmlc_error_formatter.rb', line 8 def initialize(errors, template = nil) @errors = errors @template_file = template || File.join(File.dirname(__FILE__), '..', '..', 'templates', 'standard.html.erb') @out = format! end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'lib/formatters/html_mxmlc_error_formatter.rb', line 6 def errors @errors end |
#out ⇒ Object (readonly)
Returns the value of attribute out.
6 7 8 |
# File 'lib/formatters/html_mxmlc_error_formatter.rb', line 6 def out @out end |
Instance Method Details
#format! ⇒ Object
14 15 16 17 18 19 |
# File 'lib/formatters/html_mxmlc_error_formatter.rb', line 14 def format! template = '' File.open(@template_file).each_line { |l| template << l } formatted = ERB.new(template, 0, '%<>') formatted.result(binding) end |