Class: CocinaDisplay::Forms::ResourceType

Inherits:
Form
  • Object
show all
Defined in:
lib/cocina_display/forms/resource_type.rb

Overview

A Resource Type form associated with part or all of a Cocina object.

Instance Attribute Summary

Attributes inherited from Form

#cocina

Instance Method Summary collapse

Methods inherited from Form

#flat_value, from_cocina, #initialize, #label, #type, #values

Constructor Details

This class inherits a constructor from CocinaDisplay::Forms::Form

Instance Method Details

#mods?Boolean

Is this a MODS resource type?

Returns:

  • (Boolean)


20
21
22
# File 'lib/cocina_display/forms/resource_type.rb', line 20

def mods?
  source == "MODS resource types"
end

#stanford_self_deposit?Boolean

Note:

These are handled separately when displayed.

Is this a Stanford self-deposit resource type?

Returns:

  • (Boolean)


14
15
16
# File 'lib/cocina_display/forms/resource_type.rb', line 14

def stanford_self_deposit?
  source == "Stanford self-deposit resource types"
end

#to_sString

Resource types are lowercased for display.

Returns:

  • (String)


7
8
9
# File 'lib/cocina_display/forms/resource_type.rb', line 7

def to_s
  super&.downcase
end