Module: Hyrax::ResourceTypesService

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

Class Method Summary collapse

Class Method Details

.label(id) ⇒ Object



12
13
14
# File 'app/services/hyrax/resource_types_service.rb', line 12

def self.label(id)
  authority.find(id).fetch('term')
end

.microdata_type(id) ⇒ Object

Parameters:

  • id (String)

    identifier of the resource type



17
18
19
20
# File 'app/services/hyrax/resource_types_service.rb', line 17

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

.select_optionsObject



6
7
8
9
10
# File 'app/services/hyrax/resource_types_service.rb', line 6

def self.select_options
  authority.all.map do |element|
    [element[:label], element[:id]]
  end
end