Module: Sufia::GenericFile::Metadata

Extended by:
ActiveSupport::Concern
Included in:
Sufia::GenericFile
Defined in:
app/models/concerns/sufia/generic_file/metadata.rb

Instance Method Summary collapse

Instance Method Details

#itemtypeObject

Add a schema.org itemtype



21
22
23
24
25
26
# File 'app/models/concerns/sufia/generic_file/metadata.rb', line 21

def itemtype
  # Look up the first non-empty resource type value in a hash from the config
  Sufia.config.resource_types_to_schema[resource_type.to_a.reject { |type| type.empty? }.first] || 'http://schema.org/CreativeWork'
rescue
  'http://schema.org/CreativeWork'
end