Sha256: 472bd3f31257b7c2bceb97084443d649448b089dd60f438d5cd8963ee831bf5b
Contents?: true
Size: 735 Bytes
Versions: 29
Compression:
Stored size: 735 Bytes
Contents
# frozen_string_literal: true 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
29 entries across 29 versions & 1 rubygems