Sha256: 288ff752ba2acc50caf146e716a5c2a41f55d451ba87d488da68059063634021

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 KB

Contents

module Bolognese
  # frozen_string_literal: true
  
  module Writers
    module DataciteJsonWriter
      def datacite_json
        hsh = {
          "id" => identifier,
          "doi" => doi,
          "url" => url,
          "creator" => creator,
          "title" => title,
          "publisher" => publisher,
          "resource-type-general" => types["resource_type_general"],
          "resource-type" => types["resource_type"],
          "subject" => keywords.present? ? keywords.split(", ") : nil,
          "contributor" => contributor,
          "dates" => to_datacite_json(dates),
          "publication-year" => publication_year,
          "language" => language,
          "alternate-identifiers" => alternate_identifiers,
          "related-identifiers" => to_datacite_json(related_identifiers),
          "size" => size,
          "formats" => formats,
          "version" => version,
          "rights" => rights,
          "description" => description,
          "geo-location" => geo_location,
          "funding-references" => to_datacite_json(funding_references),
          "schema-version" => schema_version,
          "provider-id" => provider_id,
          "client-id" => client_id,
          "provider" => service_provider
        }.compact
        JSON.pretty_generate hsh.presence
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bolognese-1.0.6 lib/bolognese/writers/datacite_json_writer.rb
bolognese-1.0.5 lib/bolognese/writers/datacite_json_writer.rb
bolognese-1.0.4 lib/bolognese/writers/datacite_json_writer.rb
bolognese-1.0.3 lib/bolognese/writers/datacite_json_writer.rb