Sha256: 75ea47e108a5f0e54f0d58a01865538493a43fae0a7bd5dc89bfe0be5f7cef58

Contents?: true

Size: 353 Bytes

Versions: 17

Compression:

Stored size: 353 Bytes

Contents

# frozen_string_literal: true

module Briard
  module Readers
    module DataciteJsonReader
      def read_datacite_json(string: nil, **_options)
        errors = jsonlint(string)
        return { 'errors' => errors } if errors.present?

        string.present? ? Maremma.from_json(string).transform_keys!(&:underscore) : {}
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
briard-2.9.4 lib/briard/readers/datacite_json_reader.rb
briard-2.9.3 lib/briard/readers/datacite_json_reader.rb
briard-2.9.2 lib/briard/readers/datacite_json_reader.rb
briard-2.9.1 lib/briard/readers/datacite_json_reader.rb
briard-2.9.0 lib/briard/readers/datacite_json_reader.rb
briard-2.8.2 lib/briard/readers/datacite_json_reader.rb
briard-2.8.1 lib/briard/readers/datacite_json_reader.rb
briard-2.8.0 lib/briard/readers/datacite_json_reader.rb
briard-2.7.1 lib/briard/readers/datacite_json_reader.rb
briard-2.7.0 lib/briard/readers/datacite_json_reader.rb
briard-2.6.7 lib/briard/readers/datacite_json_reader.rb
briard-2.6.6 lib/briard/readers/datacite_json_reader.rb
briard-2.6.5 lib/briard/readers/datacite_json_reader.rb
briard-2.6.4 lib/briard/readers/datacite_json_reader.rb
briard-2.6.2 lib/briard/readers/datacite_json_reader.rb
briard-2.6.1 lib/briard/readers/datacite_json_reader.rb
briard-2.6.0 lib/briard/readers/datacite_json_reader.rb