Class: Rack::PerftoolsProfiler::ProfileDataAction

Inherits:
Action
  • Object
show all
Defined in:
lib/rack/perftools_profiler/profile_data_action.rb

Direct Known Subclasses

ProfileOnce, ReturnData

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Action

#act, for_env, #initialize

Constructor Details

This class inherits a constructor from Rack::PerftoolsProfiler::Action

Class Method Details

.check_printer(printer, env = nil) ⇒ Object



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

def self.check_printer(printer, env=nil)
  if printer != nil && !ProfilerMiddleware::PRINTERS.member?(printer.to_sym)
    message = "Invalid printer type: #{printer}. Valid printer values are #{ProfilerMiddleware::PRINTERS.join(", ")}" 
    raise ProfilerArgumentError, message
  end
end

Instance Method Details

#check_printer_argObject



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

def check_printer_arg
  request = Rack::Request.new(@env)
  printer = request.GET['printer']
  self.class.check_printer(printer, @env)
end