Module: Cocina::Models::Checkable
- Included in:
- AccessRoleMember, AdminPolicy, AdminPolicyLite, AdminPolicyWithMetadata, Collection, CollectionLite, CollectionWithMetadata, DRO, DROLite, DROWithMetadata, File, FileSet, MessageDigest, RequestAdminPolicy, RequestCollection, RequestDRO, RequestFile, RequestFileSet
- Defined in:
- lib/cocina/models/checkable.rb
Overview
A common interface for interrogating a model instance’s type
Instance Method Summary collapse
- #admin_policy? ⇒ Boolean
- #collection? ⇒ Boolean
- #dro? ⇒ Boolean
- #file? ⇒ Boolean
- #file_set? ⇒ Boolean
Instance Method Details
#admin_policy? ⇒ Boolean
7 8 9 |
# File 'lib/cocina/models/checkable.rb', line 7 def admin_policy? (self.class::TYPES & AdminPolicy::TYPES).any? end |
#collection? ⇒ Boolean
11 12 13 |
# File 'lib/cocina/models/checkable.rb', line 11 def collection? (self.class::TYPES & Collection::TYPES).any? end |
#dro? ⇒ Boolean
15 16 17 |
# File 'lib/cocina/models/checkable.rb', line 15 def dro? (self.class::TYPES & DRO::TYPES).any? end |