Module: ResourceTypesService

Defined in:
app/services/resource_types_service.rb

Class Method Summary collapse

Class Method Details

.label(id) ⇒ Object



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

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

.microdata_type(id) ⇒ Object

Parameters:

  • id (String)

    identifier of the resource type



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

def self.microdata_type(id)
  I18n.t("curation_concerns.schema_org.resource_type.#{id}",
         default: CurationConcerns.config.microdata_default_type)
end

.select_optionsObject



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

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