Class: CurationConcerns::LicenseService

Inherits:
QaSelectService show all
Defined in:
app/services/curation_concerns/license_service.rb

Overview

Provide select options for the license (dcterms:rights) field

Instance Attribute Summary

Attributes inherited from QaSelectService

#authority

Instance Method Summary collapse

Methods inherited from QaSelectService

#active?, #active_elements, #label, #select_active_options, #select_all_options

Constructor Details

#initializeLicenseService

Returns a new instance of LicenseService.



4
5
6
# File 'app/services/curation_concerns/license_service.rb', line 4

def initialize
  super('licenses')
end

Instance Method Details

#include_current_value(value, _index, render_options, html_options) ⇒ Object



8
9
10
11
12
13
14
# File 'app/services/curation_concerns/license_service.rb', line 8

def include_current_value(value, _index, render_options, html_options)
  unless value.blank? || active?(value)
    html_options[:class] << ' force-select'
    render_options += [[label(value), value]]
  end
  [render_options, html_options]
end