Class: Hyrax::Work
- Defined in:
- app/models/hyrax/work.rb
Overview
The description in Hydra::Works Shared Modeling is out of date and uses terminology to describe the relationships that is no longer used in code. Update the model and link to it. This can be a simple relationship diagram with a link to the original Works Shared Modeling for historical perspective.
Some collection types limit a work to belong to one and only one collection of that type.
‘:member_ids` holds ids of child works and file sets.
Valkyrie model for ‘Work` domain objects in the Hydra Works model.
## Relationships
### Administrative Set and Work
-
Defined: The relationship is defined by the work’s ‘:admin_set_id` attribute.
-
Tested: The relationship is tested in shared spec ‘’a Hyrax::Work’‘ by testing `#admin_set_id`. Shared specs are defined in /lib/hyrax/specs/shared_specs/hydra_works.rb.
-
Administrative Set to Work: (1..m) An admin set can have many works.
-
See Hyrax::AdministrativeSet for code to get works in an admin set.
-
-
Work to Administrative Set: (1..1) A work must be in one and only one admin set.
### Collection and Work
-
Defined: The relationship is defined by the work’s ‘:member_of_collection_ids` attribute.
-
Tested: The relationship is tested in shared spec ‘’a Hyrax::Work’‘ by testing `it_behaves_like ’belongs to collections’‘. Shared specs are defined in /lib/hyrax/specs/shared_specs/hydra_works.rb.
-
Collection to Work: (0..m) A collection can have many works.
-
See Hyrax::PcdmCollection for code to get works in a collection.
-
-
Work to Collection: (0..m) A work can be in many collections.
### Work and Work
-
Defined: The relationship is defined in the parent work’s ‘:member_ids` attribute.
-
Tested: The relationship is tested in shared spec ‘’a Hyrax::Work’‘ by testing `it_behaves_like ’has_members’‘. Shared specs are defined in /lib/hyrax/specs/shared_specs/hydra_works.rb.
-
Work to child Work: (0..m) A work can have many child works.
-
Work to parent Work: (0..1) A work can be in at most one parent work.
### Work and File Set
-
Defined: The relationship is defined in the parent work’s ‘:member_ids` attribute.
-
Tested: The relationship is tested in shared spec ‘’a Hyrax::Work’‘ by testing `it_behaves_like ’has_members’‘. Shared specs are defined in /lib/hyrax/specs/shared_specs/hydra_works.rb.
-
Work to File Set: (0..m) A work can have many file sets.
-
File Set to Work: (1..1) A file set must be in one and only one work.
-
See Hyrax::FileSet for code to get the work a file set is in.
-
Instance Method Summary collapse
-
#pcdm_object? ⇒ Boolean
True.
-
#work? ⇒ Boolean
True.
Methods inherited from Resource
#collection?, #file?, #file_set?, human_readable_type, #permission_manager, #visibility, #visibility=
Methods included from WithEvents
#event_class, #events, #log_event, #stream
Instance Method Details
#pcdm_object? ⇒ Boolean
Returns true.
114 115 116 |
# File 'app/models/hyrax/work.rb', line 114 def pcdm_object? true end |
#work? ⇒ Boolean
Returns true.
120 121 122 |
# File 'app/models/hyrax/work.rb', line 120 def work? true end |