Class: URIResolver::ResolverType

Inherits:
Object
  • Object
show all
Defined in:
backend/app/lib/uri_resolver.rb

Direct Known Subclasses

ASModelResolver, TreeResolver

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.handler_for(record_type) ⇒ Object

Given a JSONModel type symbol (like :archival_object, :accession or :resource), return a resolver capable of getting back JSON records for that type.

Returns nil if this resolver isn’t applicable to that type.

Raises:

  • (NotImplementedError)


306
307
308
# File 'backend/app/lib/uri_resolver.rb', line 306

def self.handler_for(record_type)
  raise NotImplementedError.new("This method must be overriden by the implementing class")
end

Instance Method Details

#record_exists?(uri) ⇒ Boolean

True if a record (identified by URI) actually exists in the database

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


318
319
320
# File 'backend/app/lib/uri_resolver.rb', line 318

def record_exists?(uri)
  raise NotImplementedError.new("This method must be overriden by the implementing class")
end

#resolve(uris) ⇒ Object

Given a list of record URI strings (like “/repositories/2/archival_objects/123”), return an Enumerator yielding |record_uri_string, record_json|

Raises:

  • (NotImplementedError)


313
314
315
# File 'backend/app/lib/uri_resolver.rb', line 313

def resolve(uris)
  raise NotImplementedError.new("This method must be overriden by the implementing class")
end