Sha256: 780f72d6d9f4af7df0e87551b249f4f33ac04ba37cd2a7a25a6af1e38a43ba6d
Contents?: true
Size: 705 Bytes
Versions: 48
Compression:
Stored size: 705 Bytes
Contents
module Hyrax module ResourceTypesService mattr_accessor :authority self.authority = Qa::Authorities::Local.subauthority_for('resource_types') def self.select_options authority.all.map do |element| [element[:label], element[:id]] end end def self.label(id) authority.find(id).fetch('term') end ## # @param [String, nil] id identifier of the resource type # # @return [String] a schema.org type. Gives the default type if `id` is nil. 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 end end
Version data entries
48 entries across 48 versions & 1 rubygems