Module: Hydra::PCDM::AddTypeToFile

Defined in:
lib/hydra/pcdm/services/file/add_type.rb

Class Method Summary collapse

Class Method Details

.call(file, uri) ⇒ Hydra::PCDM::File

This adds an additional RDF type to an exsiting Hydra::PCDM::File

Parameters:

  • the (Hydra::PCDM::File)

    file object you want to add it to

  • term (RDF::URI)

    you want to add as the type

Returns:



10
11
12
13
14
15
16
# File 'lib/hydra/pcdm/services/file/add_type.rb', line 10

def self.call(file, uri)
  t = file..get_values(:type)
  return file if t.include?(uri)
  t << uri
  file..set_value(:type, t)
  file
end