Module: GenerativeUI::Conventions

Defined in:
lib/generative_ui/conventions.rb

Class Method Summary collapse

Class Method Details

.fetch(adapter) ⇒ Object



12
13
14
15
16
# File 'lib/generative_ui/conventions.rb', line 12

def fetch(adapter)
  @rules.fetch(adapter.to_sym) do
    raise ArgumentError, "No convention registered for adapter: #{adapter.inspect}"
  end
end

.register(adapter, &block) ⇒ Object



8
9
10
# File 'lib/generative_ui/conventions.rb', line 8

def register(adapter, &block)
  @rules[adapter.to_sym] = block
end