class Stash::Merritt::EzidHelper
Attributes
resource[R]
Public Class Methods
new(resource:)
click to toggle source
# File lib/stash/merritt/ezid_helper.rb, line 8 def initialize(resource:) @resource = resource end
Public Instance Methods
mint_id()
click to toggle source
@return [String] the identifier (DOI, ARK, or URN)
# File lib/stash/merritt/ezid_helper.rb, line 13 def mint_id ezid_client.mint_id end
update_metadata(dc3_xml:, landing_page_url:)
click to toggle source
# File lib/stash/merritt/ezid_helper.rb, line 17 def update_metadata(dc3_xml:, landing_page_url:) identifier_str = resource.identifier_str ezid_client.update_metadata(identifier_str, dc3_xml, landing_page_url) end
Private Instance Methods
ezid_client()
click to toggle source
# File lib/stash/merritt/ezid_helper.rb, line 28 def ezid_client @ezid_client ||= begin id_params = tenant.identifier_service StashEzid::Client.new( shoulder: id_params.shoulder, account: id_params.account, password: id_params.password, owner: id_params.owner, id_scheme: id_params.scheme ) end end
tenant()
click to toggle source
# File lib/stash/merritt/ezid_helper.rb, line 24 def tenant resource.tenant end