Class: PaperTrailDiff::ScopedAnalysis
- Inherits:
-
Object
- Object
- PaperTrailDiff::ScopedAnalysis
- Defined in:
- lib/paper_trail_diff/scoped_analysis.rb,
sig/generated/paper_trail_diff/scoped_analysis.rbs
Overview
What the relation form of analyze_many returns: the analyses, plus the
roots the relation could not reach.
to_ary is defined so the pair destructures, which keeps the common case
reading like the plain Hash the record form returns:
analyses, unreachable = PaperTrailDiff.analyze_many(scope: ..., limit: 500)
It deliberately does not pretend to be a Hash beyond that. Somebody iterating this object should have to decide which half they meant.
Instance Attribute Summary collapse
- #analyses ⇒ Hash[Array[String], Analysis] readonly
- #unreachable ⇒ Array[Array[String]] readonly
Instance Method Summary collapse
-
#initialize(analyses:, unreachable:) ⇒ ScopedAnalysis
constructor
: (analyses: Hash[Array[String], Analysis], unreachable: Array[Array[String]]) -> void.
-
#to_ary ⇒ [ Hash[Array[String], Analysis], Array[Array[String]] ]
: () -> [Hash[Array[String], Analysis], Array[Array[String]]].
Constructor Details
#initialize(analyses:, unreachable:) ⇒ ScopedAnalysis
: (analyses: Hash[Array[String], Analysis], unreachable: Array[Array[String]]) -> void
20 21 22 23 24 |
# File 'lib/paper_trail_diff/scoped_analysis.rb', line 20 def initialize(analyses:, unreachable:) @analyses = analyses @unreachable = Support.immutable_copy(unreachable) freeze end |
Instance Attribute Details
#analyses ⇒ Hash[Array[String], Analysis] (readonly)
16 17 18 |
# File 'lib/paper_trail_diff/scoped_analysis.rb', line 16 def analyses @analyses end |
#unreachable ⇒ Array[Array[String]] (readonly)
17 18 19 |
# File 'lib/paper_trail_diff/scoped_analysis.rb', line 17 def unreachable @unreachable end |
Instance Method Details
#to_ary ⇒ [ Hash[Array[String], Analysis], Array[Array[String]] ]
: () -> [Hash[Array[String], Analysis], Array[Array[String]]]
27 28 29 |
# File 'lib/paper_trail_diff/scoped_analysis.rb', line 27 def to_ary [analyses, unreachable] end |