Class: StackTrace::Viz::HTML

Inherits:
Object
  • Object
show all
Defined in:
lib/stack_trace/viz/html.rb

Constant Summary collapse

LAYOUT_FILE =
"../../public/main.html.erb"

Instance Method Summary collapse

Constructor Details

#initializeHTML



12
13
14
# File 'lib/stack_trace/viz/html.rb', line 12

def initialize
  @traces = []
end

Instance Method Details

#add(trace, **extra) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/stack_trace/viz/html.rb', line 24

def add(trace, **extra)
  traces << {
    description: "Generated by StackTrace::Viz",
    **extra,
    trace: trace
  }
end

#save(file_path) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/stack_trace/viz/html.rb', line 16

def save(file_path)
  file_path ||= default_file_path

  File.open(file_path, "w") { |f| f.write(content) }

  file_path
end