@@ -162,18 +162,9 @@ def mint_user_url
162162 "#{ @ezidconf . fetch ( :api , 'http://ezid:4567' ) } /shoulder/#{ @ezidconf . fetch ( :user_shoulder , 'ark:/99166/p9' ) } "
163163 end
164164
165- def mint ( url , description )
165+ def do_mint ( url , body )
166166 raise 'Minting not supported' unless @ezidconf . fetch ( :supported , true )
167167
168- # https://ezid.cdlib.org/doc/apidoc.html#internal-metadata
169- body = [ ]
170- body << "_target: #{ @ezidconf . fetch ( :target , '' ) } "
171- body << '_owner: merritt'
172- body << '_profile: erc'
173- body << '_status: reserved'
174- body << '_export: no'
175- body << "what: #{ description } "
176-
177168 r = post_url_body (
178169 url ,
179170 body : body . join ( "\n " ) ,
@@ -187,6 +178,34 @@ def mint(url, description)
187178 m [ 2 ]
188179 end
189180
181+ def mint ( url , description )
182+ # https://ezid.cdlib.org/doc/apidoc.html#internal-metadata
183+ body = [ ]
184+ body << "_target: #{ @ezidconf . fetch ( :target , '' ) } "
185+ body << '_owner: merritt'
186+ body << '_profile: erc'
187+ body << '_status: reserved'
188+ body << '_export: no'
189+ body << "what: #{ description } "
190+
191+ do_mint ( url , body )
192+ end
193+
194+ def mint_user ( url , dnid )
195+ # https://ezid.cdlib.org/doc/apidoc.html#internal-metadata
196+ body = [ ]
197+ body << "_target: #{ @ezidconf . fetch ( :target , '' ) } "
198+ body << '_owner: merritt'
199+ body << '_profile: erc'
200+ body << '_status: reserved'
201+ body << '_export: no'
202+ body << "who: #{ dnid } "
203+ body << 'what: Merritt User'
204+ body << "when: #{ Date . today . strftime ( '%Y-%m-%d' ) } "
205+
206+ do_mint ( url , body )
207+ end
208+
190209 def create_collection ( params )
191210 ark = mint ( mint_collection_url , params . fetch ( 'description' , '' ) )
192211 logger . info ( "Collection Ark Minted: #{ ark } " )
0 commit comments