lib/cocina/models/admin_policy.rb in cocina-models-0.18.0 vs lib/cocina/models/admin_policy.rb in cocina-models-0.19.0

- old
+ new

@@ -85,20 +85,10 @@ attribute :description, Description.optional.default(nil) attribute(:identification, Identification.default { Identification.new }) attribute(:structural, Structural.default { Structural.new }) def self.from_dynamic(dyn) - params = { - externalIdentifier: dyn['externalIdentifier'], - type: dyn['type'], - label: dyn['label'], - version: dyn['version'] - } - - # params[:access] = Access.from_dynamic(dyn['access']) if dyn['access'] - params[:administrative] = Administrative.from_dynamic(dyn['administrative']) if dyn['administrative'] - params[:description] = Description.from_dynamic(dyn.fetch('description')) - AdminPolicy.new(params) + AdminPolicyBuilder.build(self, dyn) end def self.from_json(json) from_dynamic(JSON.parse(json)) end