Module: Bolognese::Readers::DataciteJsonReader

Included in:
MetadataUtils
Defined in:
lib/bolognese/readers/datacite_json_reader.rb

Instance Method Summary collapse

Instance Method Details

#read_datacite_json(string: nil, **options) ⇒ Object



6
7
8
9
10
11
# File 'lib/bolognese/readers/datacite_json_reader.rb', line 6

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