Sha256: c069a3228e5c8aba182bb2704544e441453bcaea2f30c2b0c59422bff5c4b8c7

Contents?: true

Size: 539 Bytes

Versions: 59

Compression:

Stored size: 539 Bytes

Contents

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] id identifier of the resource type
  def self.microdata_type(id)
    I18n.t("curation_concerns.schema_org.resource_type.#{id}",
           default: CurationConcerns.config.microdata_default_type)
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/services/resource_types_service.rb
curation_concerns-1.7.7 app/services/resource_types_service.rb
curation_concerns-2.0.0 app/services/resource_types_service.rb
curation_concerns-2.0.0.rc2 app/services/resource_types_service.rb
curation_concerns-1.7.6 app/services/resource_types_service.rb
curation_concerns-1.7.5 app/services/resource_types_service.rb
curation_concerns-1.7.4 app/services/resource_types_service.rb
curation_concerns-1.7.3 app/services/resource_types_service.rb
curation_concerns-1.7.2 app/services/resource_types_service.rb
curation_concerns-2.0.0.rc1 app/services/resource_types_service.rb
curation_concerns-1.7.1 app/services/resource_types_service.rb
curation_concerns-1.7.0 app/services/resource_types_service.rb
curation_concerns-1.7.0.beta1 app/services/resource_types_service.rb
curation_concerns-1.6.3 app/services/resource_types_service.rb
curation_concerns-1.6.2 app/services/resource_types_service.rb
curation_concerns-1.6.1 app/services/resource_types_service.rb
curation_concerns-1.6.0 app/services/resource_types_service.rb
curation_concerns-1.5.0 app/services/resource_types_service.rb
curation_concerns-1.4.0 app/services/resource_types_service.rb
curation_concerns-1.3.3 app/services/resource_types_service.rb