Class: Valkyrie::MetadataAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/valkyrie/metadata_adapter.rb

Class Method Summary collapse

Class Method Details

.find(short_name) ⇒ #persister, #query_service

Find an adapter by its short name.


17
18
19
20
21
# File 'lib/valkyrie/metadata_adapter.rb', line 17

def find(short_name)
  symbolized_key = short_name.to_sym
  return adapters[symbolized_key] if adapters.key?(symbolized_key)
  raise "Unable to find unregistered adapter `#{short_name}'"
end

.register(adapter, short_name) ⇒ Object

Register an adapter by a short name.


10
11
12
# File 'lib/valkyrie/metadata_adapter.rb', line 10

def register(adapter, short_name)
  adapters[short_name.to_sym] = adapter
end