Class: Ddr::Component
- Includes:
- Captionable, Embargoable, HasContent, HasDerivedImage, HasExtractedText, HasMultiresImage, HasParent, Streamable
- Defined in:
- app/models/ddr/component.rb
Constant Summary
Constants inherited from Resource
Constants included from HasAdminMetadata
Constants included from Describable
Instance Method Summary collapse
Methods included from Streamable
#streamable_media_extension, #streamable_media_path, #streamable_media_type
Methods included from HasParent
#has_parent?, #parent, #publishable?
Methods included from HasMultiresImage
Methods included from HasDerivedImage
Methods included from HasContent
#content_human_size, #content_major_type, #content_size, #content_sub_type, #content_type, #image?, #pdf?, #techmd
Methods included from Embargoable
Methods included from Captionable
#caption_extension, #caption_path, #caption_type
Methods inherited from Resource
attachable_files, #attached_files_having_content, can_be_streamable?, canonical_model_name, captionable?, common_model_name, #embargo, #embargoed?, governable?, #has_admin_policy?, #has_file?, metadata_fields, #publishable?, #rights_statement, tableized_name, #title_display, #values
Methods included from HasThumbnail
Methods included from HasAdminMetadata
#effective_permissions, #effective_roles, #finding_aid, #locked?, #nonpublishable?, #policy_roles, #published?, #research_help, #resource_roles, term_names, #unpublished?
Methods included from Governable
Methods included from Describable
default_indexers, #desc_metadata_terms, #desc_metadata_vocabs, #has_desc_metadata?, indexers, indexers_for, #set_desc_metadata, #set_desc_metadata_values, term_names, vocabularies
Instance Method Details
#collection ⇒ Object
21 22 23 |
# File 'app/models/ddr/component.rb', line 21 def collection self.parent.parent rescue nil end |
#collection_id ⇒ Object
25 26 27 |
# File 'app/models/ddr/component.rb', line 25 def collection_id self.collection.id rescue nil end |
#inherited_roles ⇒ Object
33 34 35 36 37 38 39 |
# File 'app/models/ddr/component.rb', line 33 def inherited_roles if has_parent? super | parent.policy_roles else super end end |
#target ⇒ Object
29 30 31 |
# File 'app/models/ddr/component.rb', line 29 def target Ddr.query_service.find_by(id: target_id) if target_id end |