Method: Hyrax::ResourceTypesService.microdata_type

Defined in:
app/services/hyrax/resource_types_service.rb

.microdata_type(id) ⇒ String

Returns a schema.org type. Gives the default type if id is nil.

Parameters:

  • id (String, nil)

    identifier of the resource type

Returns:

  • (String)

    a schema.org type. Gives the default type if id is nil.



21
22
23
24
# File 'app/services/hyrax/resource_types_service.rb', line 21

def self.microdata_type(id)
  return Hyrax.config.microdata_default_type if id.nil?
  Microdata.fetch("resource_type.#{id}", default: Hyrax.config.microdata_default_type)
end