Class: Hyrax::PcdmCollection
- Defined in:
- app/models/hyrax/pcdm_collection.rb
Overview
Some collection types limit a work to belong to one and only one collection of that type.
Valkyrie model for Collection domain objects in the Hydra Works model.
## Relationships
### Collection and Collection (TBA)
### Collection and Work
-
Defined: The relationship is defined by the inverse relationship stored in the work’s ‘:member_of_collection_ids` attribute.
-
Tested: The work tests the relationship.
-
Collection to Work: (0..m) A collection can have many works.
-
Work to Collection: (0..m) A work can be in many collections.
-
See Hyrax::Work for code to get and set collections for the work.
-
### All children
-
There are additional methods for finding all children without respect to the child’s type.
Class Method Summary collapse
-
._hyrax_default_name_class ⇒ Class
private
An ActiveModel::Name compatible class.
Instance Method Summary collapse
-
#collection? ⇒ Boolean
True.
-
#pcdm_object? ⇒ Boolean
True.
- #permission_manager ⇒ Object
- #visibility ⇒ Object
- #visibility=(value) ⇒ Object
Methods inherited from Resource
#file?, #file_set?, human_readable_type, #work?
Methods included from WithEvents
#event_class, #events, #log_event, #stream
Class Method Details
._hyrax_default_name_class ⇒ Class
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns an ActiveModel::Name compatible class.
53 54 55 |
# File 'app/models/hyrax/pcdm_collection.rb', line 53 def self._hyrax_default_name_class Hyrax::CollectionName end |
Instance Method Details
#collection? ⇒ Boolean
Returns true.
59 60 61 |
# File 'app/models/hyrax/pcdm_collection.rb', line 59 def collection? true end |
#pcdm_object? ⇒ Boolean
Returns true.
65 66 67 |
# File 'app/models/hyrax/pcdm_collection.rb', line 65 def pcdm_object? true end |
#permission_manager ⇒ Object
69 70 71 |
# File 'app/models/hyrax/pcdm_collection.rb', line 69 def @permission_manager ||= Hyrax::PermissionManager.new(resource: self) end |
#visibility ⇒ Object
77 78 79 |
# File 'app/models/hyrax/pcdm_collection.rb', line 77 def visibility visibility_reader.read end |
#visibility=(value) ⇒ Object
73 74 75 |
# File 'app/models/hyrax/pcdm_collection.rb', line 73 def visibility=(value) visibility_writer.assign_access_for(visibility: value) end |