Sha256: 12d3cba1465d7b54f0b84964b1d7d93eb3ea50e8f1f640227ff67444bc539499
Contents?: true
Size: 1.52 KB
Versions: 3
Compression:
Stored size: 1.52 KB
Contents
require 'active_support' require 'mime/types' require 'active_fedora/aggregation' module Hydra module PCDM extend ActiveSupport::Autoload module Vocab extend ActiveSupport::Autoload eager_autoload do autoload :PCDMTerms autoload :SweetJPLTerms end end autoload :Config # models autoload_under 'models' do autoload :Collection autoload :Object autoload :File end # behavior concerns autoload_under 'models/concerns' do autoload :CollectionBehavior autoload :ObjectBehavior autoload :PcdmBehavior end autoload :CollectionIndexer autoload :ObjectIndexer # file services autoload :AddTypeToFile, 'hydra/pcdm/services/file/add_type' autoload :GetMimeTypeForFile, 'hydra/pcdm/services/file/get_mime_type' # Associations autoload :AncestorChecker, 'hydra/pcdm/ancestor_checker' autoload :Validators, 'hydra/pcdm/validators' # model validations def self.collection?(collection) return false unless collection.respond_to? :type Array(collection.type).include? Vocab::PCDMTerms.Collection end def self.object?(object) return false unless object.respond_to? :type Array(object.type).include? Vocab::PCDMTerms.Object end def self.file?(file) return false unless file.respond_to? :metadata_node Array(file.metadata_node.type).include? Vocab::PCDMTerms.File end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
hydra-pcdm-0.8.0.beta1 | lib/hydra/pcdm.rb |
hydra-pcdm-0.7.0 | lib/hydra/pcdm.rb |
hydra-pcdm-0.6.0 | lib/hydra/pcdm.rb |