Class: Hyrax::Identifier::Registrar

Inherits:
Object
  • Object
show all
Defined in:
app/services/hyrax/identifier/registrar.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(builder:) ⇒ Registrar

Returns a new instance of Registrar.

Parameters:


25
26
27
# File 'app/services/hyrax/identifier/registrar.rb', line 25

def initialize(builder:)
  @builder = builder
end

Instance Attribute Details

#builderHyrax::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.

Parameters:

  • type (Symbol)
  • opts (Hash)

Options Hash (**opts):

Returns:

Raises:

  • (ArgumentError)

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.

Parameters:

  • object (#id)

Returns:

  • (#identifier)

Raises:

  • (NotImplementedError)

    when the method is abstract


36
37
38
# File 'app/services/hyrax/identifier/registrar.rb', line 36

def register!(*)
  raise NotImplementedError
end