Sha256: 5bdd1163bc4bf7c00027a0aad52dda4eba1b218fb336c9ec3c0db5430b11d7b9
Contents?: true
Size: 508 Bytes
Versions: 15
Compression:
Stored size: 508 Bytes
Contents
module Hydra::PCDM module AddTypeToFile # This adds an additional RDF type to an exsiting Hydra::PCDM::File # # @param [Hydra::PCDM::File] the file object you want to add it to # @param [RDF::URI] term you want to add as the type # # @return [Hydra::PCDM::File] the updated file def self.call(file, uri) t = file.metadata_node.get_values(:type) return file if t.include?(uri) t << uri file.metadata_node.set_value(:type, t) file end end end
Version data entries
15 entries across 15 versions & 1 rubygems