Sha256: 93c60f810d6019bf9a8b626cca9592a7587b085231910e3b73d862264fb425ba

Contents?: true

Size: 472 Bytes

Versions: 9

Compression:

Stored size: 472 Bytes

Contents

# frozen_string_literal: true

module Bolognese
  module Readers
    module CrossciteReader
      def read_crosscite(string: nil, **options)
        errors = jsonlint(string)
        return { "errors" => errors } if errors.present?

        crosscite = string.present? ? Maremma.from_json(string) : {}
        crosscite["publisher"] = normalize_publisher(crosscite["publisher"]) if crosscite.fetch("publisher", nil).present?

        crosscite
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bolognese-2.3.2 lib/bolognese/readers/crosscite_reader.rb
bolognese-2.3.0 lib/bolognese/readers/crosscite_reader.rb
bolognese-2.2.0 lib/bolognese/readers/crosscite_reader.rb
bolognese-2.1.1 lib/bolognese/readers/crosscite_reader.rb
bolognese-2.1.0 lib/bolognese/readers/crosscite_reader.rb
bolognese-2.0.3 lib/bolognese/readers/crosscite_reader.rb
bolognese-2.0.2 lib/bolognese/readers/crosscite_reader.rb
bolognese-2.0.1 lib/bolognese/readers/crosscite_reader.rb
bolognese-2.0.0 lib/bolognese/readers/crosscite_reader.rb