Class: RShade::Formatter::Html
Constant Summary collapse
- FILE_NAME =
'stacktrace.html'.freeze
- 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.
6 7 8 |
# File 'lib/rshade/formatter/html.rb', line 6 def formatter @formatter end |
Instance Method Details
#call(event_store) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/rshade/formatter/html.rb', line 15 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 |