Module: Hydra::Works::CollectionBehavior
- Extended by:
- ActiveSupport::Concern
- Included in:
- Collection
- Defined in:
- lib/hydra/works/models/concerns/collection_behavior.rb
Overview
8) Hydra::Works::Collection can have descriptive metadata
9) Hydra::Works::Collection can have access metadata
Instance Method Summary collapse
-
#collection? ⇒ Boolean
Whether this instance is a Hydra::Works Collection.
-
#file_set? ⇒ Boolean
Whether this instance is a Hydra::Works::FileSet.
- #ordered_work_ids ⇒ Object
- #ordered_works ⇒ Object
-
#work? ⇒ Boolean
Whether this instance is a Hydra::Works Generic Work.
- #work_ids ⇒ Object
- #works ⇒ Object
Instance Method Details
#collection? ⇒ Boolean
Returns whether this instance is a Hydra::Works Collection.
48 49 50 |
# File 'lib/hydra/works/models/concerns/collection_behavior.rb', line 48 def collection? true end |
#file_set? ⇒ Boolean
Returns whether this instance is a Hydra::Works::FileSet.
58 59 60 |
# File 'lib/hydra/works/models/concerns/collection_behavior.rb', line 58 def file_set? false end |
#ordered_work_ids ⇒ Object
35 36 37 |
# File 'lib/hydra/works/models/concerns/collection_behavior.rb', line 35 def ordered_work_ids ordered_works.map(&:id) end |
#ordered_works ⇒ Object
31 32 33 |
# File 'lib/hydra/works/models/concerns/collection_behavior.rb', line 31 def ordered_works ordered_members.to_a.select(&:work?) end |
#work? ⇒ Boolean
Returns whether this instance is a Hydra::Works Generic Work.
53 54 55 |
# File 'lib/hydra/works/models/concerns/collection_behavior.rb', line 53 def work? false end |
#work_ids ⇒ Object
43 44 45 |
# File 'lib/hydra/works/models/concerns/collection_behavior.rb', line 43 def work_ids works.map(&:id) end |
#works ⇒ Object
39 40 41 |
# File 'lib/hydra/works/models/concerns/collection_behavior.rb', line 39 def works members.select(&:work?) end |