Sha256: 3f4e900d02f973e27bd072f1baa6f9fe89b775b0321e620953acdf26be4159d7

Contents?: true

Size: 922 Bytes

Versions: 138

Compression:

Stored size: 922 Bytes

Contents

module Bolognese
  class Orcid < Metadata
    include Bolognese::Utils
    # def get_orcid_metadata(orcid, options = {})
    #   return {} if orcid.blank?

    #   url = "https://pub.orcid.org/v2.0/#{orcid}/person"
    #   response = Maremma.get(url, options.merge(accept: "json"))

    #   name = response.body.fetch("data", {}).fetch("name", nil)
    #   return { "errors" => 'Resource not found.' } unless name.present?

    #   author = { "family" => name.fetch("family-name", {}).fetch("value", nil),
    #              "given" => name.fetch("given-names", {}).fetch("value", nil) }

    #   { "author" => [author],
    #     "title" => "ORCID record for #{[author.fetch('given', nil), author.fetch('family', nil)].compact.join(' ')}",
    #     "container-title" => "ORCID Registry",
    #     "issued" => Time.now.year.to_s,
    #     "URL" => orcid_as_url(orcid),
    #     "type" => 'entry' }
    # end
  end
end

Version data entries

138 entries across 138 versions & 1 rubygems

Version Path
bolognese-0.9.78 lib/bolognese/orcid.rb
bolognese-0.9.77 lib/bolognese/orcid.rb
bolognese-0.9.76 lib/bolognese/orcid.rb
bolognese-0.9.75 lib/bolognese/orcid.rb
bolognese-0.9.74 lib/bolognese/orcid.rb
bolognese-0.9.73 lib/bolognese/orcid.rb
bolognese-0.9.72 lib/bolognese/orcid.rb
bolognese-0.9.71 lib/bolognese/orcid.rb
bolognese-0.9.70 lib/bolognese/orcid.rb
bolognese-0.9.69 lib/bolognese/orcid.rb
bolognese-0.9.68 lib/bolognese/orcid.rb
bolognese-0.9.67 lib/bolognese/orcid.rb
bolognese-0.9.66 lib/bolognese/orcid.rb
bolognese-0.9.65 lib/bolognese/orcid.rb
bolognese-0.9.64 lib/bolognese/orcid.rb
bolognese-0.9.63 lib/bolognese/orcid.rb
bolognese-0.9.62 lib/bolognese/orcid.rb
bolognese-0.9.61 lib/bolognese/orcid.rb
bolognese-0.9.60 lib/bolognese/orcid.rb
bolognese-0.9.59 lib/bolognese/orcid.rb