Class: Hyrax::Identifier::Registrar
- Inherits:
-
Object
- Object
- Hyrax::Identifier::Registrar
- Defined in:
- app/services/hyrax/identifier/registrar.rb
Instance Attribute Summary collapse
Class Method Summary collapse
-
.for(type, **opts) ⇒ Hyrax::Identifier::Registrar
A registrar for the given type.
Instance Method Summary collapse
-
#initialize(builder:) ⇒ Registrar
constructor
A new instance of Registrar.
- #register! ⇒ #identifier abstract
Constructor Details
#initialize(builder:) ⇒ Registrar
Returns a new instance of Registrar.
25 26 27 |
# File 'app/services/hyrax/identifier/registrar.rb', line 25 def initialize(builder:) @builder = builder end |
Instance Attribute Details
#builder ⇒ Hyrax::Identifier::Builder
21 22 23 |
# File 'app/services/hyrax/identifier/registrar.rb', line 21 def builder @builder end |
Class Method Details
.for(type, **opts) ⇒ Hyrax::Identifier::Registrar
Returns a registrar for the given type.
12 13 14 15 |
# File 'app/services/hyrax/identifier/registrar.rb', line 12 def for(type, **opts) return Hyrax.config.identifier_registrars[type].new(**opts) if Hyrax.config.identifier_registrars.include?(type) raise ArgumentError, "Hyrax::Identifier::Registrar not found to handle #{type}" end |
Instance Method Details
#register! ⇒ #identifier
This method is abstract.
36 37 38 |
# File 'app/services/hyrax/identifier/registrar.rb', line 36 def register!(*) raise NotImplementedError end |