Module: Hecks::Projections::Shape
- Extended by:
- Hecks::Projector::Target
- Defined in:
- lib/hecks/projections/shape.rb
Overview
THE STORAGE SHAPE of one bluebook — the same structural form
StorageShape.mint_hash hashes to name an era, which is what makes
a bump/no-bump question answerable by diffing two of these.
THE RETROFIT, and the point of it: Runtime::StorageShape.project
was written long before this framework existed, and it already
takes exactly one bluebook, already returns a plain Hash, already
touches no disk and no live runtime — it even already uses the
word. Nothing about it was shaped to fit call(bluebook:, options:).
That it fits anyway, by a two-line keyword adapter and no change to
StorageShape itself, is the evidence that the protocol is a real
description of what projections do here rather than a shape fitted
around its own first example (:ir, whose call is to_h, proves
much less on its own).
Class Method Summary collapse
-
.call(bluebook:, options: {}) ⇒ Object
ADR 0033 —
Runtime::StorageShapelives in the era persistence plugin now; the:shapeprojection itself stays registered unconditionally (the seamspec/projector_seam_spec.rbenforces is "every file here registers," not "every projection always succeeds") but refuses clearly if asked to run with the plugin unloaded, rather than raising on an undefined constant.
Methods included from Hecks::Projector::Target
projection_declares, projection_emits, projection_key, projection_requires, projects_as
Class Method Details
.call(bluebook:, options: {}) ⇒ Object
ADR 0033 — Runtime::StorageShape lives in the era persistence
plugin now; the :shape projection itself stays registered
unconditionally (the seam spec/projector_seam_spec.rb enforces
is "every file here registers," not "every projection always
succeeds") but refuses clearly if asked to run with the plugin
unloaded, rather than raising on an undefined constant.
34 35 36 37 38 39 40 41 |
# File 'lib/hecks/projections/shape.rb', line 34 def call(bluebook:, options: {}) unless Ports::Persistence.plugin?(:era) raise "the :shape projection needs the era persistence plugin loaded " \ "(require \"hecks/ports/persistence/plugins/era\")" end Runtime::StorageShape.project(bluebook) end |