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.intersect?(AdminPolicy::TYPES)
end

#collection?Boolean

Returns:

  • (Boolean)


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

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

#dro?Boolean

Returns:

  • (Boolean)


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

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

#file?Boolean

Returns:

  • (Boolean)


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

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

#file_set?Boolean

Returns:

  • (Boolean)


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

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