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-0.14.0.pre3 app/services/resource_types_service.rb
curation_concerns-0.14.0.pre2 app/services/resource_types_service.rb
curation_concerns-0.14.0.pre1 app/services/resource_types_service.rb
curation_concerns-0.13.1 app/services/resource_types_service.rb
curation_concerns-0.13.0 app/services/resource_types_service.rb
curation_concerns-0.12.0 app/services/resource_types_service.rb
curation_concerns-0.12.0.pre9 app/services/resource_types_service.rb
curation_concerns-0.12.0.pre8 app/services/resource_types_service.rb
curation_concerns-0.12.0.pre7 app/services/resource_types_service.rb
curation_concerns-0.12.0.pre6 app/services/resource_types_service.rb
curation_concerns-0.12.0.pre5 app/services/resource_types_service.rb
curation_concerns-0.12.0.pre4 app/services/resource_types_service.rb
curation_concerns-0.12.0.pre3 app/services/resource_types_service.rb
curation_concerns-0.12.0.pre2 app/services/resource_types_service.rb
curation_concerns-0.12.0.pre1 app/services/resource_types_service.rb
curation_concerns-0.11.0 app/services/resource_types_service.rb
curation_concerns-0.11.0.rc1 app/services/resource_types_service.rb
curation_concerns-0.10.0 app/services/resource_types_service.rb
curation_concerns-0.9.0 app/services/resource_types_service.rb