Class: Cocina::Models::Builders::RightsDescriptionBuilder
- Inherits:
-
Object
- Object
- Cocina::Models::Builders::RightsDescriptionBuilder
- Defined in:
- lib/cocina/models/builders/rights_description_builder.rb
Overview
RightsDescriptionBuilder
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(cocina_object) ⇒ RightsDescriptionBuilder
constructor
A new instance of RightsDescriptionBuilder.
-
#object_access ⇒ Cocina::Models::AdminPolicyDefaultAccess
This is set up to work for APOs, but this method is to be overridden on sub classes.
Constructor Details
#initialize(cocina_object) ⇒ RightsDescriptionBuilder
Returns a new instance of RightsDescriptionBuilder.
13 14 15 |
# File 'lib/cocina/models/builders/rights_description_builder.rb', line 13 def initialize(cocina_object) @cocina = cocina_object end |
Class Method Details
.build(cocina_object) ⇒ Object
9 10 11 |
# File 'lib/cocina/models/builders/rights_description_builder.rb', line 9 def self.build(cocina_object) new(cocina_object).build end |
Instance Method Details
#build ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/cocina/models/builders/rights_description_builder.rb', line 23 def build return 'controlled digital lending' if object_access.controlledDigitalLending return ['dark'] if object_access.view == 'dark' object_level_access end |
#object_access ⇒ Cocina::Models::AdminPolicyDefaultAccess
This is set up to work for APOs, but this method is to be overridden on sub classes
19 20 21 |
# File 'lib/cocina/models/builders/rights_description_builder.rb', line 19 def object_access @object_access ||= cocina.administrative.accessTemplate end |