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.31 lib/bolognese/orcid.rb
bolognese-0.9.30 lib/bolognese/orcid.rb
bolognese-0.9.29 lib/bolognese/orcid.rb
bolognese-0.9.28 lib/bolognese/orcid.rb
bolognese-0.9.27 lib/bolognese/orcid.rb
bolognese-0.9.26 lib/bolognese/orcid.rb
bolognese-0.9.25 lib/bolognese/orcid.rb
bolognese-0.9.24 lib/bolognese/orcid.rb
bolognese-0.9.23 lib/bolognese/orcid.rb
bolognese-0.9.22 lib/bolognese/orcid.rb
bolognese-0.9.21 lib/bolognese/orcid.rb
bolognese-0.9.20 lib/bolognese/orcid.rb
bolognese-0.9.19 lib/bolognese/orcid.rb
bolognese-0.9.18 lib/bolognese/orcid.rb
bolognese-0.9.17 lib/bolognese/orcid.rb
bolognese-0.9.16 lib/bolognese/orcid.rb
bolognese-0.9.15 lib/bolognese/orcid.rb
bolognese-0.9.14 lib/bolognese/orcid.rb
bolognese-0.9.13 lib/bolognese/orcid.rb
bolognese-0.9.11 lib/bolognese/orcid.rb