Class: Rack::PerftoolsProfiler::ReturnData

Inherits:
ProfileDataAction show all
Defined in:
lib/rack/perftools_profiler/return_data.rb

Instance Method Summary collapse

Methods inherited from ProfileDataAction

check_printer, #check_printer_arg

Methods inherited from Action

#act, for_env

Constructor Details

#initialize(*args) ⇒ ReturnData

Returns a new instance of ReturnData.



5
6
7
8
# File 'lib/rack/perftools_profiler/return_data.rb', line 5

def initialize(*args)
  super
  check_printer_arg
end

Instance Method Details

#responseObject



10
11
12
13
14
15
16
# File 'lib/rack/perftools_profiler/return_data.rb', line 10

def response
  if @profiler.profiling?
    [400, {'Content-Type' => 'text/plain'}, ['No profiling data available.']]
  else
    @middleware.profiler_data_response(@profiler.data(@data_params))
  end
end