Module: Cocina::Models::Checkable

Overview

A common interface for interrogating a model instance’s type

Instance Method Summary collapse

Instance Method Details

#admin_policy?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/cocina/models/checkable.rb', line 7

def admin_policy?
  (self.class::TYPES & AdminPolicy::TYPES).any?
end

#collection?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/cocina/models/checkable.rb', line 11

def collection?
  (self.class::TYPES & Collection::TYPES).any?
end

#dro?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/cocina/models/checkable.rb', line 15

def dro?
  (self.class::TYPES & DRO::TYPES).any?
end

#file?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/cocina/models/checkable.rb', line 19

def file?
  (self.class::TYPES & File::TYPES).any?
end

#file_set?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/cocina/models/checkable.rb', line 23

def file_set?
  (self.class::TYPES & FileSet::TYPES).any?
end