Sha256: 3cf7ed3c10d2014dd33389e4127cb9c093e231cddadbd92c86f01a078a2a5466

Contents?: true

Size: 363 Bytes

Versions: 15

Compression:

Stored size: 363 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! { |key| key.underscore } : {}
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
briard-2.4.2 lib/briard/readers/datacite_json_reader.rb
briard-2.4.1 lib/briard/readers/datacite_json_reader.rb
briard-2.4 lib/briard/readers/datacite_json_reader.rb
briard-2.3.1 lib/briard/readers/datacite_json_reader.rb
briard-2.3 lib/briard/readers/datacite_json_reader.rb
briard-2.2.7 lib/briard/readers/datacite_json_reader.rb
briard-2.2.6 lib/briard/readers/datacite_json_reader.rb
briard-2.2.4 lib/briard/readers/datacite_json_reader.rb
briard-2.2.3 lib/briard/readers/datacite_json_reader.rb
briard-2.2.1 lib/briard/readers/datacite_json_reader.rb
briard-2.2 lib/briard/readers/datacite_json_reader.rb
briard-2.1 lib/briard/readers/datacite_json_reader.rb
briard-2.0.2 lib/briard/readers/datacite_json_reader.rb
briard-2.0.1 lib/briard/readers/datacite_json_reader.rb
briard-2.0 lib/briard/readers/datacite_json_reader.rb