Module: PoolLint::ExecutionState
- Defined in:
- lib/poollint/execution_state.rb
Constant Summary collapse
- KEY =
:poollint_inspecting- SUPPRESSION_KEY =
:poollint_suppressed
Class Method Summary collapse
Class Method Details
.inspecting? ⇒ Boolean
12 13 14 |
# File 'lib/poollint/execution_state.rb', line 12 def inspecting? ActiveSupport::IsolatedExecutionState[KEY] == true end |
.suppress ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/poollint/execution_state.rb', line 28 def suppress previous = ActiveSupport::IsolatedExecutionState[SUPPRESSION_KEY] ActiveSupport::IsolatedExecutionState[SUPPRESSION_KEY] = true yield ensure ActiveSupport::IsolatedExecutionState[SUPPRESSION_KEY] = previous end |
.suppressed? ⇒ Boolean
24 25 26 |
# File 'lib/poollint/execution_state.rb', line 24 def suppressed? ActiveSupport::IsolatedExecutionState[SUPPRESSION_KEY] == true end |