lib/cocina/models/request_dro.rb in cocina-models-0.19.0 vs lib/cocina/models/request_dro.rb in cocina-models-0.20.0

- old
+ new

@@ -3,11 +3,11 @@ module Cocina module Models # A Request to create a digital repository object. (to create) object. # This is same as a DRO, but without externalIdentifier (as that wouldn't have been created yet) # See http://sul-dlss.github.io/cocina-models/maps/DRO.json - class RequestDRO < Dry::Struct + class RequestDRO < Struct attribute :type, Types::String.enum(*DRO::TYPES) attribute :label, Types::Strict::String attribute :version, Types::Coercible::Integer attribute(:access, DRO::Access.default { DRO::Access.new }) attribute(:administrative, DRO::Administrative.default { DRO::Administrative.new }) @@ -16,10 +16,10 @@ attribute :description, Description.optional.default(nil) attribute(:identification, DRO::Identification.default { DRO::Identification.new }) attribute(:structural, DRO::Structural.default { DRO::Structural.new }) def self.from_dynamic(dyn) - DROBuilder.build(self, dyn) + RequestDRO.new(dyn) end def self.from_json(json) from_dynamic(JSON.parse(json)) end