Class: Stackprofiler::WebUI

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/stackprofiler/web_ui.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ WebUI

Returns a new instance of WebUI.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/stackprofiler/web_ui.rb', line 9

def initialize(options={})
  if options[:file]
    data = File.read options[:file]
    run = Oj.load data
    if run.is_a?(Hash) && run.has_key?(:frames)
      run = Run.new 'unknown', run, Time.now
    end

    RunDataSource.runs << run
  end

  super
end