Class: ActiveRecord::ExplainRegistry
- Inherits:
-
Object
- Object
- ActiveRecord::ExplainRegistry
- Defined in:
- lib/active_record/explain_registry.rb
Overview
This is a thread locals registry for EXPLAIN. For example
ActiveRecord::ExplainRegistry.queries
returns the collected queries local to the current thread.
Instance Attribute Summary collapse
-
#collect ⇒ Object
Returns the value of attribute collect.
-
#queries ⇒ Object
readonly
Returns the value of attribute queries.
Instance Method Summary collapse
- #collect? ⇒ Boolean
-
#initialize ⇒ ExplainRegistry
constructor
A new instance of ExplainRegistry.
- #reset ⇒ Object
Constructor Details
#initialize ⇒ ExplainRegistry
Returns a new instance of ExplainRegistry.
24 25 26 |
# File 'lib/active_record/explain_registry.rb', line 24 def initialize reset end |
Instance Attribute Details
#collect ⇒ Object
Returns the value of attribute collect.
21 22 23 |
# File 'lib/active_record/explain_registry.rb', line 21 def collect @collect end |
#queries ⇒ Object (readonly)
Returns the value of attribute queries.
22 23 24 |
# File 'lib/active_record/explain_registry.rb', line 22 def queries @queries end |
Instance Method Details
#collect? ⇒ Boolean
28 29 30 |
# File 'lib/active_record/explain_registry.rb', line 28 def collect? @collect end |
#reset ⇒ Object
32 33 34 35 |
# File 'lib/active_record/explain_registry.rb', line 32 def reset @collect = false @queries = [] end |