Class: Rack::PerftoolsProfiler::Action
- Inherits:
-
Object
- Object
- Rack::PerftoolsProfiler::Action
- Defined in:
- lib/rack/perftools_profiler/action.rb
Direct Known Subclasses
CallAppDirectly, ProfileDataAction, StartProfiling, StopProfiling
Class Method Summary collapse
Instance Method Summary collapse
- #act ⇒ Object
-
#initialize(env, profiler, middleware) ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize(env, profiler, middleware) ⇒ Action
Returns a new instance of Action.
5 6 7 8 9 10 11 |
# File 'lib/rack/perftools_profiler/action.rb', line 5 def initialize(env, profiler, middleware) @env = env @request = Rack::Request.new(env) @data_params = @request.params.clone @profiler = profiler @middleware = middleware end |
Class Method Details
.for_env(env, profiler, middleware) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rack/perftools_profiler/action.rb', line 17 def self.for_env(env, profiler, middleware) request = Rack::Request.new(env) klass = case request.path when '/__start__' StartProfiling when '/__stop__' StopProfiling when '/__data__' ReturnData else if ProfileOnce.has_special_param?(request) ProfileOnce else CallAppDirectly end end klass.new(env, profiler, middleware) end |
Instance Method Details
#act ⇒ Object
13 14 15 |
# File 'lib/rack/perftools_profiler/action.rb', line 13 def act # do nothing end |