Module: Assistant::InputBuilder::Registry
- Included in:
- Assistant::InputBuilder
- Defined in:
- lib/assistant/input_builder/registry.rb
Overview
Per-class registry of input definitions. Each Service subclass gets its own hash keyed by attribute name with the original keyword options frozen for introspection (used by Service#initialize for M1 defaulting and by the M11 RBS generator).
Instance Method Summary collapse
-
#input_definitions ⇒ Hash{Symbol => Hash}
Per-class hash of input definitions, keyed by attribute name.
-
#register_input_definition(name:, type:, options:) ⇒ Hash
Register or replace an input definition.
Instance Method Details
#input_definitions ⇒ Hash{Symbol => Hash}
Per-class hash of input definitions, keyed by attribute name.
Values are frozen { type:, **options } hashes. Read by
Service#initialize (M1 defaulting), by Service#input_snapshot
(M-S4), and by the M11 RBS generator.
14 15 16 |
# File 'lib/assistant/input_builder/registry.rb', line 14 def input_definitions @input_definitions ||= {} end |
#register_input_definition(name:, type:, options:) ⇒ Hash
Register or replace an input definition.
24 25 26 |
# File 'lib/assistant/input_builder/registry.rb', line 24 def register_input_definition(name:, type:, options:) input_definitions[name] = { type:, ** }.freeze end |