Class: Apiwork::Adapter::Registry
- Defined in:
- lib/apiwork/adapter/registry.rb
Class Method Summary collapse
Methods inherited from Registry
clear!, delete, exists?, find, find!, keys, store, values
Class Method Details
.register(adapter_class) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/apiwork/adapter/registry.rb', line 7 def register(adapter_class) raise ArgumentError, 'Adapter must inherit from Apiwork::Adapter::Base' unless adapter_class < Base raise ArgumentError, "Adapter #{adapter_class} must define an adapter_name" unless adapter_class.adapter_name store[adapter_class.adapter_name] = adapter_class end |