Class: OccamsRecord::EagerLoaders::Tracer
- Inherits:
-
Struct
- Object
- Struct
- OccamsRecord::EagerLoaders::Tracer
- Defined in:
- lib/occams-record/eager_loaders/tracer.rb
Overview
A low-memory way to trace the path of eager loads from any point back to the root query
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#through ⇒ Object
Returns the value of attribute through.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
4 5 6 |
# File 'lib/occams-record/eager_loaders/tracer.rb', line 4 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent
4 5 6 |
# File 'lib/occams-record/eager_loaders/tracer.rb', line 4 def parent @parent end |
#through ⇒ Object
Returns the value of attribute through
4 5 6 |
# File 'lib/occams-record/eager_loaders/tracer.rb', line 4 def through @through end |
Instance Method Details
#lookup(trace = self) ⇒ Object
9 10 11 12 13 |
# File 'lib/occams-record/eager_loaders/tracer.rb', line 9 def lookup(trace = self) return [] if trace.nil? name = trace.through ? "through(#{trace.name})" : trace.name lookup(trace.parent) << name end |
#to_s ⇒ Object
5 6 7 |
# File 'lib/occams-record/eager_loaders/tracer.rb', line 5 def to_s lookup.join(".") end |