Module: Hydra::PCDM

Extended by:
ActiveSupport::Autoload
Defined in:
lib/hydra/pcdm.rb,
lib/hydra/pcdm/config.rb,
lib/hydra/pcdm/version.rb,
lib/hydra/pcdm/validators.rb,
lib/hydra/pcdm/models/file.rb,
lib/hydra/pcdm/pcdm_indexer.rb,
lib/hydra/pcdm/models/object.rb,
lib/hydra/pcdm/object_indexer.rb,
lib/hydra/pcdm/ancestor_checker.rb,
lib/hydra/pcdm/vocab/pcdm_terms.rb,
lib/hydra/pcdm/models/collection.rb,
lib/hydra/pcdm/collection_indexer.rb,
lib/hydra/pcdm/services/file/add_type.rb,
lib/hydra/pcdm/services/file/get_mime_type.rb,
lib/hydra/pcdm/models/concerns/pcdm_behavior.rb,
lib/hydra/pcdm/models/concerns/object_behavior.rb,
lib/hydra/pcdm/models/concerns/collection_behavior.rb

Defined Under Namespace

Modules: AddTypeToFile, AncestorChecker, CollectionBehavior, Config, GetMimeTypeForFile, ObjectBehavior, PcdmBehavior, Validators, Vocab Classes: Collection, CollectionIndexer, File, Object, ObjectIndexer, PCDMIndexer

Constant Summary collapse

VERSION =
'1.1.0'.freeze

Class Method Summary collapse

Class Method Details

.collection?(collection) ⇒ Boolean

model validations

Returns:

  • (Boolean)


45
46
47
48
# File 'lib/hydra/pcdm.rb', line 45

def self.collection?(collection)
  return false unless collection.respond_to? :type
  Array(collection.type).include? Vocab::PCDMTerms.Collection
end

.file?(file) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
58
# File 'lib/hydra/pcdm.rb', line 55

def self.file?(file)
  return false unless file.respond_to? :metadata_node
  Array(file..type).include? Vocab::PCDMTerms.File
end

.object?(object) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
53
# File 'lib/hydra/pcdm.rb', line 50

def self.object?(object)
  return false unless object.respond_to? :type
  Array(object.type).include? Vocab::PCDMTerms.Object
end