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.10.21 lib/bolognese/orcid.rb
bolognese-0.10.20 lib/bolognese/orcid.rb
bolognese-0.10.19 lib/bolognese/orcid.rb
bolognese-0.10.18 lib/bolognese/orcid.rb
bolognese-0.10.17 lib/bolognese/orcid.rb
bolognese-0.10.16 lib/bolognese/orcid.rb
bolognese-0.10.15 lib/bolognese/orcid.rb
bolognese-0.10.14 lib/bolognese/orcid.rb
bolognese-0.10.13 lib/bolognese/orcid.rb
bolognese-0.10.11 lib/bolognese/orcid.rb
bolognese-0.10.10 lib/bolognese/orcid.rb
bolognese-0.10.9 lib/bolognese/orcid.rb
bolognese-0.10.8 lib/bolognese/orcid.rb
bolognese-0.10.7 lib/bolognese/orcid.rb
bolognese-0.10.6 lib/bolognese/orcid.rb
bolognese-0.10.5 lib/bolognese/orcid.rb
bolognese-0.10.4 lib/bolognese/orcid.rb
bolognese-0.10.3 lib/bolognese/orcid.rb
bolognese-0.10.2 lib/bolognese/orcid.rb
bolognese-0.10 lib/bolognese/orcid.rb