Class: RShade::Formatter::Trace::Html
- Defined in:
- lib/rshade/formatter/trace/html.rb
Constant Summary collapse
- FILE_NAME =
'stacktrace.html'- TEMPLATE =
'html/template.html.erb'
Instance Attribute Summary collapse
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
Instance Method Summary collapse
- #call(event_store) ⇒ Object
-
#initialize(args = {}) ⇒ Html
constructor
A new instance of Html.
- #template ⇒ Object
- #write_to_file(data) ⇒ Object
Constructor Details
Instance Attribute Details
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
9 10 11 |
# File 'lib/rshade/formatter/trace/html.rb', line 9 def formatter @formatter end |
Instance Method Details
#call(event_store) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/rshade/formatter/trace/html.rb', line 19 def call(event_store) data = formatter.call(event_store) erb_template = ERB.new(template) content = erb_template.result_with_hash({ json: data.to_json }) write_to_file(content) end |