Module: Hecks::Ports::Persistence::Plugin

Defined in:
lib/hecks/ports/persistence/plugin.rb

Overview

A tiny, real seam — ADR 0033. Core never names a persistence plugin; a plugin makes itself known as a side effect of being required, the same way an adapter's own .rb file already registers itself (Runtime::Registry#add_adapter) rather than core listing adapter names anywhere. register_plugin is the ENTIRE contract a plugin must satisfy: anything responding to contribute_boot_gates(registry, gates) (a no-op is a valid implementation).

This is deliberately NOT the same registry Hecks::Projector uses (ADR 0027) or Runtime::BootGates (ADR 0031) — each of those is scoped to its own seam (IR-in/artifact-out; per-boot phased gates). A shared base is deferred until a third registry actually wants one.

NAME-KEYED, PROCESS-WIDE, NOT PER-BOOT — unlike BootGates (one instance per Loader.boot call, because gate REGISTRATION is capability-conditional per registry), a persistence plugin is either required into this process or it isn't; there is no "this boot's registry doesn't need it" case to isolate against, so a plain module-level hash is the right shape here, not an instantiable class.

Class Method Summary collapse

Class Method Details

.any?Boolean

Returns:

  • (Boolean)


39
# File 'lib/hecks/ports/persistence/plugin.rb', line 39

def any? = !@plugins.empty?

.eachObject



35
36
37
# File 'lib/hecks/ports/persistence/plugin.rb', line 35

def each(&)
  @plugins.each_value(&)
end

.register(name, plugin) ⇒ Object



27
28
29
# File 'lib/hecks/ports/persistence/plugin.rb', line 27

def register(name, plugin)
  @plugins[name.to_sym] = plugin
end

.registered?(name) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/hecks/ports/persistence/plugin.rb', line 31

def registered?(name)
  @plugins.key?(name.to_sym)
end