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/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

Constant Summary collapse

VERSION =
'0.8.2'.freeze

Class Method Summary collapse

Class Method Details

.collection?(collection) ⇒ Boolean

model validations

Returns:

  • (Boolean)


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

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

.file?(file) ⇒ Boolean

Returns:

  • (Boolean)


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

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)


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

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