Class: Hyrax::AdminSetSelectionPresenter::OptionsEntry
- Inherits:
-
Object
- Object
- Hyrax::AdminSetSelectionPresenter::OptionsEntry
- Defined in:
- app/presenters/hyrax/admin_set_selection_presenter.rb
Overview
Instance Attribute Summary collapse
- #admin_set ⇒ AdministrativeSet, SolrDocument
- #permission_template ⇒ PermissionTemplate
- #permit_sharing ⇒ Boolean
Instance Method Summary collapse
- #data ⇒ Hash{String => Object}
- #id ⇒ String
-
#initialize(admin_set:, permission_template: nil, permit_sharing: false) ⇒ OptionsEntry
constructor
A new instance of OptionsEntry.
- #label ⇒ String
- #result ⇒ Array<String, String, Hash>
Constructor Details
#initialize(admin_set:, permission_template: nil, permit_sharing: false) ⇒ OptionsEntry
Returns a new instance of OptionsEntry.
58 59 60 61 62 |
# File 'app/presenters/hyrax/admin_set_selection_presenter.rb', line 58 def initialize(admin_set:, permission_template: nil, permit_sharing: false) @admin_set = admin_set @permission_template = @permit_sharing = permit_sharing end |
Instance Attribute Details
#admin_set ⇒ AdministrativeSet, SolrDocument
52 53 54 |
# File 'app/presenters/hyrax/admin_set_selection_presenter.rb', line 52 def admin_set @admin_set end |
#permission_template ⇒ PermissionTemplate
52 |
# File 'app/presenters/hyrax/admin_set_selection_presenter.rb', line 52 attr_accessor :admin_set, :permission_template, :permit_sharing |
#permit_sharing ⇒ Boolean
52 |
# File 'app/presenters/hyrax/admin_set_selection_presenter.rb', line 52 attr_accessor :admin_set, :permission_template, :permit_sharing |
Instance Method Details
#data ⇒ Hash{String => Object}
84 85 86 87 88 89 90 91 92 93 94 |
# File 'app/presenters/hyrax/admin_set_selection_presenter.rb', line 84 def data {}.tap do |data| data['data-sharing'] = permit_sharing if data.merge!(data_for()) else data['data-release-no-delay'] = true end end end |
#id ⇒ String
78 79 80 |
# File 'app/presenters/hyrax/admin_set_selection_presenter.rb', line 78 def id admin_set.id.to_s end |
#label ⇒ String
72 73 74 |
# File 'app/presenters/hyrax/admin_set_selection_presenter.rb', line 72 def label Array(admin_set.title).first || admin_set.to_s end |
#result ⇒ Array<String, String, Hash>
66 67 68 |
# File 'app/presenters/hyrax/admin_set_selection_presenter.rb', line 66 def result [label, id, data] end |