Sha256: dd884dc26f131caae6f7158b8984b4402e487f95a66fb9dde55ef1cba5f354df
Contents?: true
Size: 753 Bytes
Versions: 18
Compression:
Stored size: 753 Bytes
Contents
module CurationConcerns # This is an abstract class to provide select options from a # questioning authority backed authority class QaSelectService attr_reader :authority def initialize(authority_name) @authority = Qa::Authorities::Local.subauthority_for(authority_name) end def select_all_options authority.all.map do |element| [element[:label], element[:id]] end end def select_active_options active_elements.map { |e| [e[:label], e[:id]] } end def active?(id) authority.find(id).fetch('active') end def label(id) authority.find(id).fetch('term') end def active_elements authority.all.select { |e| active?(e.fetch('id')) } end end end
Version data entries
18 entries across 18 versions & 1 rubygems