Sha256: 6032f6e37302ae8c20ef75b6dc3c86063bdc62099925bfcd695c83a72fd2ab46

Contents?: true

Size: 604 Bytes

Versions: 5

Compression:

Stored size: 604 Bytes

Contents

module Bolognese
  # frozen_string_literal: true
  
  module Writers
    module DataciteJsonWriter
      def datacite_json
        # Remove the following change for the schema 4.5 release
        if crosscite_hsh.present?
          datacite_json_hsh = crosscite_hsh
          datacite_json_hsh['publisher'] = self.publisher['name'] if self.publisher&.respond_to?(:to_hash) && self.publisher.has_key?('name') && !self.publisher['name'].blank?
          JSON.pretty_generate datacite_json_hsh.transform_keys! { |key| key.camelcase(uppercase_first_letter = :lower) }
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bolognese-2.1.0 lib/bolognese/writers/datacite_json_writer.rb
bolognese-2.0.3 lib/bolognese/writers/datacite_json_writer.rb
bolognese-2.0.2 lib/bolognese/writers/datacite_json_writer.rb
bolognese-2.0.1 lib/bolognese/writers/datacite_json_writer.rb
bolognese-2.0.0 lib/bolognese/writers/datacite_json_writer.rb