Class: URIResolver::ResolverType
- Inherits:
-
Object
- Object
- URIResolver::ResolverType
- Defined in:
- backend/app/lib/uri_resolver.rb
Direct Known Subclasses
Class Method Summary collapse
-
.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.
Instance Method Summary collapse
-
#record_exists?(uri) ⇒ Boolean
True if a record (identified by URI) actually exists in the database.
-
#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 .
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.
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
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|
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 |