Class: Rigor::Effects::EffectTable
- Inherits:
-
Object
- Object
- Rigor::Effects::EffectTable
- Includes:
- Enumerable
- Defined in:
- lib/rigor/effects/effect_table.rb
Overview
The whole-project effect graph after propagation: every method key the run collected, with its direct summary and its transitive closure (ADR-103 WD12).
An EffectTable is not a diagnostic and never enters rigor check's stream. It hangs off the
runner for the report of this slice and the snapshot of #381 to read, exactly as
ADR-102 draws the report-versus-diagnostic line.
Defined Under Namespace
Classes: Entry
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object
- #each ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(entries) ⇒ EffectTable
constructor
A new instance of EffectTable.
- #keys ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(entries) ⇒ EffectTable
Returns a new instance of EffectTable.
65 66 67 68 |
# File 'lib/rigor/effects/effect_table.rb', line 65 def initialize(entries) @entries = entries.sort_by { |key, _| key }.to_h.freeze freeze end |
Class Method Details
.empty ⇒ Object
60 61 62 |
# File 'lib/rigor/effects/effect_table.rb', line 60 def self.empty @empty ||= new(EMPTY_ENTRIES) end |
Instance Method Details
#[](key) ⇒ Object
70 71 72 |
# File 'lib/rigor/effects/effect_table.rb', line 70 def [](key) @entries[key] end |
#each ⇒ Object
78 79 80 |
# File 'lib/rigor/effects/effect_table.rb', line 78 def each(&) @entries.each_value(&) end |
#empty? ⇒ Boolean
87 88 89 |
# File 'lib/rigor/effects/effect_table.rb', line 87 def empty? @entries.empty? end |
#keys ⇒ Object
74 75 76 |
# File 'lib/rigor/effects/effect_table.rb', line 74 def keys @entries.keys end |
#size ⇒ Object
83 84 85 |
# File 'lib/rigor/effects/effect_table.rb', line 83 def size @entries.size end |