Class: Rigor::Cache::RbsConstantTable

Inherits:
Object
  • Object
show all
Defined in:
lib/rigor/cache/rbs_constant_table.rb

Overview

Cache producer that materialises every RBS-declared constant to its translated ‘Rigor::Type` form and stores the result as a `Hash<String, Rigor::Type>` keyed by canonical constant name. This is the v0.0.8 first cached producer per ADR-6 § 7; it caches a post-translation artefact so the cache value is `Marshal`-clean (RBS-native objects carry `RBS::Location`, which lacks `_dump_data`).

Cache descriptor shape is shared with every other cache producer that depends on the RBS environment — see Rigor::Cache::RbsDescriptor.build for the slot definitions.

Constant Summary collapse

PRODUCER_ID =
"rbs.constant_type_table"

Class Method Summary collapse

Class Method Details

.fetch(loader:, store:) ⇒ Hash{String => Rigor::Type}

Parameters:

Returns:



24
25
26
27
28
29
# File 'lib/rigor/cache/rbs_constant_table.rb', line 24

def self.fetch(loader:, store:)
  descriptor = RbsDescriptor.build(loader)
  store.fetch_or_compute(producer_id: PRODUCER_ID, params: {}, descriptor: descriptor) do
    compute(loader)
  end
end