Class: BaseIndexer::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/base_indexer/collection.rb

Overview

It caches the collection information such as name and catkey

Instance Method Summary collapse

Constructor Details

#initialize(collection_druid) ⇒ Collection

Returns a new instance of Collection.



6
7
8
# File 'lib/base_indexer/collection.rb', line 6

def initialize(collection_druid)
  @collection_druid = collection_druid
end

Instance Method Details

#collection_infoArray<String>

Returns the collection name from cache, otherwise will fetch it from PURL.

Parameters:

  • collection_druid (String)

    is the druid for a collection e.g., ab123cd4567

Returns:

  • (Array<String>)

    the collection data or [] if there is no name and catkey or the object is not a collection



15
16
17
# File 'lib/base_indexer/collection.rb', line 15

def collection_info
  from_cache || from_purl || {}
end