Class: Hyrax::AdminSetOptionsPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/hyrax/admin_set_options_presenter.rb

Overview

Presents the options for the AdminSet widget on the create/edit form

Instance Method Summary collapse

Constructor Details

#initialize(service) ⇒ AdminSetOptionsPresenter

Returns a new instance of AdminSetOptionsPresenter.


4
5
6
# File 'app/presenters/hyrax/admin_set_options_presenter.rb', line 4

def initialize(service)
  @service = service
end

Instance Method Details

#select_options(access = :deposit) ⇒ Object

Return AdminSet selectbox options based on access type

Parameters:

  • access (Symbol) (defaults to: :deposit)

    :deposit, :read, or :edit


10
11
12
13
14
# File 'app/presenters/hyrax/admin_set_options_presenter.rb', line 10

def select_options(access = :deposit)
  @service.search_results(access).map do |admin_set|
    [admin_set.to_s, admin_set.id, data_attributes(admin_set)]
  end
end